Context:
I have a backend workflow that reschedules itself the following day at a specific time once it finishes. However, the workflow inputs for the next run are based on when the previous workflow finished.
Meaning, if there are new things that happen between the time that workflow finishes and when the next workflow starts, it won’t capture them.
Is there a way around this? Or am I building my workflow incorrectly?
You put the search in the action where you want to use the data.
I have no idea what you are doying in the workflow.
For example let’s say you have a list of users as input of your workflow and you use an action “modify a list of things” to add a flag on the users. Because you scheduled the workflow yesterday you have a list of users updated to yesterday’s data. You can modify your action to run on a new search for users instead of the input so you get an updated list.
Thanks for taking the time responding here…I’ll add some more context.
I have an initial trigger in my admin area that schedules an API workflow for current date/time.
The params I’m using at user, index, count
The backend workflow steps are as follows:
Create a new thing (job) with 2 fields (worker = user:item #index, date = current date rounded down to day
Set a things slug
Recursive job creation
Schedules another API workflow (#2)
Workflow 2:
1: Adds a list of creators to the inital thing from the previous workflow
2. If the job is < than the count of jobs and there are still creators to be assigned, it continues
3. If the job is >= to the count and there are still creators to be added, it resets the job count to 1 and goes back again to step 1
4. If the job is >= to the count and there are no more creators to be added, it schedules the workflow for the following day.
This is where it gets tricky and I can’t find a solution. I don’t know where to put the search that you suggested.
My understanding is this: in your last action you schedule a workflow for tomorrow and you set as inputs a list of user, an index, the count of another search. Your problem is that tomorrow that list of user will not be updated with the current situation of the db.
What you can try is: do a new search anywhere you would use the input search.
If you use the input in multiple actions then just create a custom event with the same input type, move your logic inside the custom event so you can reference the inputs there, from your main workflow trigger the custom event do a new search as input.
There may be multiple reasons why it does not work: order of exececuton (see here) or maybe something that you create/modify in a workflow it’s not synched with the search of the next workflow.