Hi @dplescia,
Yes, you can achieve this by using the $.flow.exit() method to stop the workflow execution for the rest of the day if the information has changed. You can also use a cron expression to reset the flag at the end of the day. Here’s an example of how you can do this:
- Add a variable to store the flag, for example,
informationChanged:
let informationChanged = false;
- In your workflow, after you check if the information has changed, set the
informationChangedflag totrue:
if (/* information has changed */) {
informationChanged = true;
}
- Before the main logic of your workflow, check if the
informationChangedflag istrue. If it is, use$.flow.exit()to stop the workflow execution:
if (informationChanged) {
$.flow.exit("Information has changed, stopping the workflow for today.");
}
- To reset the flag at the end of the day, you can create another workflow with a Schedule trigger that runs at a specific time (e.g., 1:00 PM) and resets the
informationChangedflag tofalse:
informationChanged = false;
Remember to set the Schedule trigger for this new workflow to run at the desired time, like 1:00 PM.
This way, your main workflow will stop executing for the rest of the day once the information has changed, and the flag will be reset at the end of the day by the second workflow.
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.