Calling another scenario and wait for it to finish

I want to have one “main” scenario run other scenarios.
These scenarios watch for new emails or google sheet rows, and add them to a share data storage.
Then, I want the main scenario to continue running and get the results from the data storage.
Problem is - the main scenario doesn’t wait for them to stop running.
How do I solve that?
If I use webhooks and wait for a response for the sub scenarios, I won’t be able to use a trigger like “watch new emails”.

What would be the solution?

If you want to do it using multiple scenarios while awaiting completion,

The sub-scenarios need to be using Custom Webhook triggers and Webhook Response modules.

The main scenario needs to use HTTP Make a Request to those Webhooks in the other scenarios.

1 Like

Thank you, but as I mentioned - if I’ll use webhooks on the sub scenarios how can I use “watch new emails” or “watch new google sheets rows”?

Your setup depends on where the “action” starts. If your workflow is initiated by an email or a change on Google Sheets, you can insert a HTTP module at the end of those scenarios, that triggers the same webhook.

You can then insert that webhook, at the start of your other scenario, to do the work on the datastore.

2 Likes

So this will require additional scenario, wouldn’t it?
One that activates the scenarios, and one that listens for them to finish using a webhook?
But the problem is I want two scenarios to run, and only when the two are finished - run my main

It all depends on how your total workflow is structured. And for that, we lack a bit of information on what they are supposed to do exactly :slight_smile:
There may be optimizations to be done to avoid this.

If, let’s say as an example, your workflow starts with the Email. You can start there:

Scenario 1) New email arrives at your inbox - do something - fire webhook to trigger scenario 2
Scenario 2) Webhook is triggered - do something with Google Sheets and ClickUp - fire webhook to trigger scenario 3
Scenario 3) Webhook is triggered - do something with the datastore

In scenario 2, your webhook simulates the “watch new row” module, as it will also kickstart your scenario. You then just follow the webhook with something that looks up the newest row and performs actions on that row (or with the data stored within that row).

Alternatively, you could potentially combine this within 1 scenario as well, and use a router. Routers follow their paths from top to bottom (if you haven’t filtered things obviously).

Hope that helps,

Thomas - Nola Digital

2 Likes

Thanks @NolaDigital, but I still don’t understand - if a scenario is triggered by a webhook, how do I “watch new emails” and “watch new rows”? These are triggers, and can’t be used if the trigger is a webhook

I’ll give more details so you can help me figure this out -
Every X minutes I want to check for new emails and new rows in the google sheet (with timestamps).
I want to combine them together, sort them using timestamps, and then throw them into clickup.

For this, I now have what I described above, where the main triggers the other scenarios, but it doesn’t wait for them which is my problem.

What do you suggest at this point?

Hello @guym88,

The “Watch …” modules in this case can only be trigger modules and aren’t instant, they run on a schedule or on-demand when triggered by clicking Run Once or using Make’s API to kick them off.
As you know, you cannot use two of them in any one scenario because each scenario can only have at most one trigger module.

What you might be able to do, and this was probably already presented to you one way or another in previous posts, is this:

  1. Schedule your Gmail Watch EMail existing scenario to run every 15 minutes.
  2. Schedule your Google Sheets scenario to run On Demand only.
    Kick this one off at the end of your first scenario using Make Run a Scenario module.
  3. Schedule your “main” scenario to run On Demand only as well and kick off the “main” at the end of scenario number 2.

Another option is just running everything in a single scenario.
You won’t be able to use the “Watch” module for Google Sheets, but you can mimic its functionality by using a Data Store to store information about the most recent row pulled from Google Sheets.

Here’s how that might look:
Gmail Watch Emails (scheduled every X minutes) →
Array Aggregator →
Data Store pull the last row number, default of 2 if it’s not been run before →
Google Sheets Get Row Values (specify Ax:Z65000 where x is the row number from the previous Data Store module →
Array Aggregator →
Data Store (store the last row number that contained data + 1 →
Everything from Main after the Data Store.

At this point you should not need to use Data Store for anything other than storing the last read row number + 1. All the data you need for ClickUp is in the two arrays produced by the Array Aggregators.

The schedule for the GMail Watch Emails scenario controls the frequency of all this.

1 Like