ServiceNow Flow Designer - Make api call 3 days before the start date

Sachin Gavhane
Giga Guru

I need help to figure out exact flow designer steps for the following requirement

Catalog item variable : Start_date = 26th Dec

need to make an api call in flow 3 days before the above start date, means it should make api call on 26-3 = 23rd Dec 2025

current date is as per system-- ex: current date is 16th Dec 2025

can someone help me with exact implementation steps in the flow

Appreciate your help

3 REPLIES 3

Bhavya11
Kilo Patron
Kilo Patron

Hi @Sachin Gavhane ,

 

you can try this way in flow designer.

 

Please use below 3 steps.
1.First you have to use Get catalog Variables in the flow designer and select date variable

Bhavya11_0-1765881773222.png

2. Create Custom action to subtraction of the date of logic here; call this action in flow[ input of this is RITM record]

Bhavya11_1-1765883718750.png

Bhavya11_3-1765883875515.png

 

 

 

3.Use Wait for the Condition in Flow Designer with relative duration, now you will have the option to select  Date, variable using the data picker from action which in previous steps action output.

Bhavya11_4-1765883889354.png

flow will be look like below

Bhavya11_5-1765883983079.png

 

after that add your logic to trigger the API

 

If this information proves useful, kindly mark it as helpful or accepted solution.

 

Thanks,

BK

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Sachin Gavhane 

You can do this

-> create a flow variable of type Date/time and use "Set Flow Variables" flow logic and store 3 days subtracted from your date/time variable value

AnkurBawiskar_0-1765886784925.png

AnkurBawiskar_2-1765886907205.png

 

var dateValue = new GlideDateTime(fd_data.trigger.request_item.variables.start_date);
dateValue.addDaysUTC(-3);
return dateValue.getValue();

-> then use "Wait for a duration of time" flow logic and it will wait till that date value in flow variable

AnkurBawiskar_1-1765886876599.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

nayanmule
Tera Guru

You can add a new variable in your flow with the type as Date.

The best way to do this without scripting is to make use of function in the flow designer.

nayanmule_0-1765890423728.pngnayanmule_1-1765890470811.png

 You can thus use this updated variable less than 3 days from your selected date and add a wait for duration thereby.

 

But please note that if your date selection is a long future date like a month or a year from now. The flow will still  keep waiting till that time and may cause performance issues. So, it depends on your use case.

 

If my response helped you, kindly mark it as helpful and accept the solution.

 

Regards,

Nayan