Scheduled Bridge Workflows
Lately I've had problems with Bridge workflows erroring randomly. This is a problem for several of my solutions, so I'm developing safety net workflows to catch actions that were missed when the errors occurred.
But I'm stuck because up to now, I've been able to use rundata from the trigger to guide the rest of the workflow.
Here's a quick description of my current workflow:
If a row is added to Sheet 1, grab some values from it and populate them to a new row in Sheet 2. This is easy because I can use the row data from the trigger data. But as I mentioned, if the workflow errors during a run, Bridge basically forgets all about it and no one knows that row was missed and not added to Sheet 2.
My safety net is to add a step to the workflow where I'll have Bridge check a box to confirm the workflow completed for that row on Sheet 1.
Then I'll add a second time-based workflow to search Sheet 1 every 15 minutes for unchecked boxes. I'm pretty sure the Search Sheet module is my first step, but how do I then tell Bridge to take each of those rows it finds and create new rows in Sheet 2?
Tagging my Bridge friends @Samuel Mueller @Brian_Richardson @Kelly Moore @Genevieve P. 😀
Best Answers
-
You could call the first workflow (the one that was supposed to do the work in the first place) as a child of the second “checker” workflow. That will trigger the first workflow just the same as if it had been triggered by a row add.
-
If it were me I would use JavaScript and an API call - one workflow. But you can also go the search sheet method. Search sheet method would require the use of a child workflow. The child workflow would basically just be an add row module and input the data you want from the search sheet.
Brian talked about the child workflow in his presentation today. it is essentially a for each loop, where it will evaluate each row found in search sheet one at a time. So the child workflow you create just needs one add row module, and you will use data references from the trigger. IF your search sheet finds 5 matching rows, the child workflow would run 5 times.
-
For the "Number of runs" put {{states.startstate.smartsheet.search_sheet.data}}
It will send along each object in the data array, one at a time to the child. So for the first child run it will receive object 0 and all the data in it. For the second child run it will receive object 1.
The child entity values are used to send along additional data outside of object 0, object 1 etc.
So for example if you needed to send along a date that you generated earlier in the parent workflow, to the child workflow, you'd put a child entity in for date with either a fixed value or the reference to the date from earlier in the parent workflow.
-
I agree with the posts above! 🙂
I have a lot of workflow pairs - a Parent workflow with an Array of multiple options, and a Child workflow that loops through that array to take an action based on each individual object.
This is where you'd get the reference from for the "number of runs":
Here's more information: Creating a loop in a workflow
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Yeah @Julie Fortney it's exactly as my image shows. Like Brian and Genevieve said, put the data reference in the number of runs. What I have there should be the reference exactly. Brian explained what happens after in the child workflow well. If you need static data that persists in every child run, you would add that in child entity values. You don't always need anything in child entity values
Answers
-
You could call the first workflow (the one that was supposed to do the work in the first place) as a child of the second “checker” workflow. That will trigger the first workflow just the same as if it had been triggered by a row add.
-
If it were me I would use JavaScript and an API call - one workflow. But you can also go the search sheet method. Search sheet method would require the use of a child workflow. The child workflow would basically just be an add row module and input the data you want from the search sheet.
Brian talked about the child workflow in his presentation today. it is essentially a for each loop, where it will evaluate each row found in search sheet one at a time. So the child workflow you create just needs one add row module, and you will use data references from the trigger. IF your search sheet finds 5 matching rows, the child workflow would run 5 times.
-
Aha, now I'm getting somewhere.
What references should I use for the Child entity values? I need to send the values from two columns, the Source and Source ID.
If I copy the Source ID reference from Row 0's data, it looks like this:
{{states.startstate.smartsheet.search_sheet.data.0.Source ID}}
I thought maybe I could replace the 0 with "row" and it would dynamically pull the correct row number for each run, but that didn't work.
-
For the "Number of runs" put {{states.startstate.smartsheet.search_sheet.data}}
It will send along each object in the data array, one at a time to the child. So for the first child run it will receive object 0 and all the data in it. For the second child run it will receive object 1.
The child entity values are used to send along additional data outside of object 0, object 1 etc.
So for example if you needed to send along a date that you generated earlier in the parent workflow, to the child workflow, you'd put a child entity in for date with either a fixed value or the reference to the date from earlier in the parent workflow.
-
I agree with the posts above! 🙂
I have a lot of workflow pairs - a Parent workflow with an Array of multiple options, and a Child workflow that loops through that array to take an action based on each individual object.
This is where you'd get the reference from for the "number of runs":
Here's more information: Creating a loop in a workflow
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Yeah @Julie Fortney it's exactly as my image shows. Like Brian and Genevieve said, put the data reference in the number of runs. What I have there should be the reference exactly. Brian explained what happens after in the child workflow well. If you need static data that persists in every child run, you would add that in child entity values. You don't always need anything in child entity values
-
Thank you all! The child workflow functionality hadn't quite clicked, but now the pieces are in place and my workflow is running as expected.
-
@Julie Fortney child workflow is an essential tool that you will definitely use again. Glad you got it working!
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives