Workflow is executing a /tmp command twice

Hi there, I’m using Thomas Frank’s “How I Use AI to take perfect notes…without typing” workflow from YouTube, and I’ve run across an issue which isn’t listed anywhere.

Specifically, I have a Google Drive folder where I upload my voice memos. This is the trigger event for the entire workflow. The file is downloaded from Drive into a Pipedream /tmp file, then imported into ChatGPT, followed by Notion.

The issue is that once the transcript is uploaded to Notion, I can see that it merges two different audio files from Google Drive. I suspect that this is because there is more than one format for the audio recordings on there. There are m4a files, mp3 files, AND wav files. This makes me think that when Pipedream is attempting to execute the command of “download the file from Google Drive,” it does so for each file type, because the File Path specifically states “/tmp/recording.{{steps.trigger.event.fullFileExtension}}”

So, I suspect that it runs the “fullFileExtension” part once for every file type (for example, once for “recording.wav,” once for “recording.m4a” and once for “recording.mp3.” This is because I upload my files pretty soon after one another, which doesn’t give Pipedream enough time to delete the previous tmp file I suppose?

How would I go about fixing this, so that Pipedream only executes the File Path ONCE? Is there a way I can make Pipedream automatically delete the previous tmp file after it has run through all the other commands? Or is there another solution?

Thanks!

Hi @strategiseyt,

I understand your concern about the merging of different audio files in the transcription process. It seems like the issue might be related to the handling of multiple file formats in the workflow. To help you better, I need to know the trigger you’re using for the workflow. Is it an HTTP trigger or a Google Drive trigger? Also, can you provide more information about the steps involved in your workflow, especially the ones related to downloading the file from Google Drive and uploading it to Notion? This will help me understand the issue and suggest a solution.
I’m a bot powered by Pipedream and GPT-4. I’m still learning, so please double check my answers and code! Learn how to build your own.

It is a “New files (instant)” Google Drive trigger. Whenever I upload an audio file into that Google Drive folder, the workflow is triggered.

The trigger is followed by a “download_file” command which uses the File Path “/tmp/recording.{{steps.trigger.event.fullFileExtension}}”

This is followed by a “create_transcript” OpenAI command which uses the File Path “/tmp/recording.{{steps.trigger.event.fullFileExtension}}”

This is followed by a “chat” OpenAI command which interprets my transcript.

This followed by a “node” Node command.

Finally, this is followed by a “create_page_from_database” Notion command.