How to create a random scenario to trigger others scenarios?

Hello.
I’m having difficulty creating a scenario that runs another scenario that I already have.
Even though we know that we can run the scenario at a certain time, day, etc., I needed this to happen randomly.
Could you give me any idea on how to create a small system that pulls random dates (which I can create in gpt) or another way and so, starting from these random dates and times, it triggers a certain scenario?

Thanks.

Dan Kroll

Hi @Daniel_Kroll,

Just to clarify what you’re trying to do:

  • You want to create a list of random date/time pairs
  • Then, execute a scenario on/at those date/times?

I’ve got too many ideas for this to share them all, but unless some sort of regularity is allowed (for example, running once a day, but at a random time), I don’t know how to do everything easily 100% within Make.

First thought was to use Airtable or SmartSuite. Both have Automation engines capable of specifying a date/time field and trigger when that date/time is reached. You just need to keep feeding the table some records with future dates.

Without any third-party apps, here’s an example of how you could try to do it within Make only:

  1. Scenario #1. Runs on a schedule. Generate a random date/time. Use Make API to reschedule the scenario you need to run, scenario #2. See this reference.
  2. Modify scenario to run the first scenario, which will then reschedule this scenario.

Hope that makes sense.

3 Likes

Hello, Donald, how are you?
Firstly, thanks for the answering! :slightly_smiling_face:

Yes, perfect: I want, for example, that “x” scenario runs every day, in a random quantity ( for example, today it will run 3 times, tomorrow 4, another day just 2 times) and each of the runs will happen in a random time of the day.

I will try first to use your idea with Airtable and see if I can trigger this scenario, using another scenario like you suggested. :slight_smile:
Soon I will inform here!

Chers!

Dan kroll

Ok, so if you’re going to be running the scenario more than once a day then maybe it’s easier to use something like Airtable to help you out.

If you were going to do only once a day, then it might be easy to do it all in Make.
Just have scenario 1 create a random number for the hour and another for the minute.
use parseDate to create an actual datetime object from that, then use Make API to re-schedule scenario 2 to run at that time for tomorrow’s date.

3 Likes

Hello again! :slight_smile:

I am trying to do via Airtable, I think it must be a little different that it works. The scenario is linked on demand. in the on demand function. Then when Airtable sends the information and he executes at the date and time.

I still don’t get it how trigger Airtable on demand, when it received the random date…

Any tips, will help! :slight_smile:

Chers!
Dan K

I have an idea for a scenario that I used the cronjob.org service for. The good thing is that it is free and worked very well. The idea is to create cronjobs that run on the dates you have generated. When the cronjob is triggered, it will send a signal to your scenario through a Webhook to execute it on the scheduled date.

To implement this, you need to create an account on cronjob.org and get an API key. Then, use the HTTP module (Make a Basic Auth Request) and enter the following parameters:

and in Request Content, this JSON, changing the CAPITALS LETTER VALUES for your VALUES:

{“job”:
{ “url”:“YOUR_WEBHOOK_URL”,
“enabled”:“true”,
“saveResponses”:true,
“title”: “ANT TTLE TOY WANT”,
“requestMethod”:“POST”,

“schedule”: { “timezone”: “Europe/Berlin”,
“hours”: [0],
“mdays”: [DAY],
“minutes”: [0],
“months”: [MONTH],
“wdays”: [-1]
},
“requestMethod”:{“body”:“POST”},
“extendedData”: {“body”:“ANY INFORMATION YOU WANT”}
}
}

3 Likes

This is pretty cool! Thanks for the tip!

2 Likes

My apologies, it’s not as straight forward in Airtable.

  1. In Make, create a scenario that starts with a Mailhook. The second module is a Make Run a Scenario. Or, you can just start the other scenario with a mailhook instead of whatever is triggering it now.
  2. In Airtable, you’ll have a date/time field with the randomly-generated date and time from some other source
  3. In Airtable, you’ll have a formula field that will use DATETIME_DIFF(Date,NOW(), ‘seconds’). This will show the number of seconds until the date/time will be reached, which is a positive number.
  4. In Airtable, create an Automation that will trigger when the record is updated and the number of seconds in the formula is 0 or less (indicating that it is now in the past). For the action, send an email to the mailhook email address generated by Make in the first step. This email action will run the scenario.

I think this should all work.

3 Likes

Hello,

I was trying to create a randomization system for a scenario and tested various ideas, but I wasn’t successful with some of them. I tried using cronjob.org, but it doesn’t generate randomness.

I also attempted to use Airtable, but I can’t get it to send information to Make on a specific date from my calendar. Even if I send information to Make, the Airtable module doesn’t trigger the scenario automatically.

I need Airtable to send information via Webhook to Make because I understand that through a webhook, it will immediately trigger the scenario. However, I don’t understand how Airtable sends information to the webhook as soon as a specific date or time on the calendar arrives. I couldn’t create that condition for it. I only saw how it triggers a script for Make when a new field is created.

Does anyone have a solution using Airtable or SmartSuite for me to create this randomness?

Chers!

Dan K

So what I’ve done is create 1 scenario that starts by generating a random number X between 2 and 5, inclusive. This is the number of times I want to generate a random time for tomorrow’s date.

For each X:

  • Generate a random hour and minute
  • String together a date/time object using tomorrow’s date and the randomly-generated hour and minute numbers.
  • Use Make Create a Scenario module to create a new scenario based on a blueprint.
  • Use Make Turn a Scenario’s Scheduling On/Off to turn on the scenario that was just created.

Schedule this scenario to run once a day.

The result, after the scenario runs, are between 2 and 5 scenarios that get scheduled to run the following day, at randomly-generated times.
These scenarios self-delete after they execute so it keeps the scenario list clean.

If you’re on the Free plan, I don’t think this will work because you need to be on a paid plan to create scenarios via Make modules/API.
However, you can still get an idea on how to create random times.

Here’s a blueprint as well in case you want to check it out.
Random Scenario Generator.json (28.9 KB)

If you’re still interested in the Airtable and/or SmartSuite solutions, I’ll work on something in SmartSuite first and report on that soon as I have more time.

2 Likes

Hello, Donald, good morning, how are you?
Donald, it worked perfectly!
Two things, if you can help me (see images below)

1 – Is there a way in your system of inserting a diary time range to make randomization? For example, I want him to manage the Randomly Daily Hours from 08 AM to 21pm. Is this possible?

2 – This is a side question: on my case, in my scenario,When it duplicates it, it would always predict the next line of this Excel it carries, and he is always repeating the same line. I know this is not directly linked to this issue, but if you have any idea how I can do it, thank you! :slight_smile:

Thank you very much!

Att
Dan Kroll

Hi Dan,

For this, in your formula you will need to adjust the values for generating the hour:

  • Multiply your random number {{random}} by 14.
  • Round that to the nearest integer using the round() function.
  • Add 8.
  • This should ensure you get a number between 8 and 21.

For your other questions, I’m sorry, but I don’t quite understand the problem there.
I feel like we would be more productive if you could share an overall explanation of what you’re trying to accomplish.

3 Likes

Hello, Donald, how are you?
It worked 100% fine!!! :slight_smile: Thank you and the other people that help me on this process.
About API Google sheets, it was easy to resolve :slight_smile:
Thanks again a lot!
Chers!

Dan K