How to Display Real-Time Status of a Workflow Step or Output Using JavaScript?

This topic was automatically generated from Slack. You can find the original thread here.

Greetings. I have a workflow that can take up to several minutes to complete. In my javascript I use await fetch(pipedreamURL) to trigger the workflow. Is there any method available where I can somehow output the status of a current workflow step that is being processed, or even the status of the output in real time while waiting for the process to complete?

Probably best to use the data store.

Just have the workflow store its status in the data store, and you can read the current status whenever you want.

Thanks Marco for your reply. However, the objective is to return the information of the process directly back to javascript area where the information can be either displayed on the App’s Chrome browser console.log or loaded directly into an HTML element in real time before the end of the workflow. If I have 20 files being processed, I would like to have the status of file that is being processed at the time it is processed.

If your interested, I have figured out a process to achieve this task. I use Dropbox for filesystem IO, but I’m sure any filesystem will work.
Step 1. Within the Pipedream workflow assign an output file that is written to during the workflow at the beginning of the each file be processed.
Step 2. Create a javascript WebWorker to read the output file every second.
Step 3. At the end of the Pipedream workflow, write a terminating string to the output file that ends the WebWorker process loop.

The nice thing about this process is that I use a progress bar to indicate the progress of the workflow in the background without consuming processing time within my app.

Plus, using this method of the javascript fetch statement within the WebWorker, it saves on the number of Pipedream invocations. A read for every second would certain run up my bill.

Scott.