Using Wait in flow.

cristinamat
Giga Contributor

I need to configure a Wait to pause a Yokohama version Flow, using a user-defined date.

Since this is a variable date that could be as far as 60 days away, it exceeds the allowed 999-hour limit. How can I achieve this?

I have read that I can use the following instructions:

Action: Select 'Wait for a duration'.

Duration type: Choose 'Relative Duration'.

Relative duration restriction: Set to 'Stay in-step until'.

Data Pill: Drag the variable containing the calculated date here (e.g. Creation date + 60 days).

 

However, I cannot see the option 'Relative duration restriction: Set to Stay in-step until'.

Will it still work?

 

Thanks Cristina

4 REPLIES 4

Itallo Brandão
Tera Guru

Hi @cristinamat ,

The reason you cannot see the option 'Stay in-step until' is that those instructions likely refer to SLA Definitions or the legacy Workflow Editor. In Flow Designer, the logic works differently.

In Flow Designer, the logic is "Wait for a duration" (Time), not "Wait until a Date" (Calendar).

To solve this and bypass the 999-hour manual limit, you simply need to calculate the difference between "Now" and your "Target Date" before the wait step.

Here is the implementation steps:

Step 1: Calculate the Duration (Script Step) Since you have a specific date (e.g., Created + 60 days), you need to convert that into a Duration object.

  1. Add a Script Action (Core > Script) to your Flow.

  2. Input Variable: Name: target_date | Value: [Drag your Date Pill here]

  3. Output Variable: Name: wait_duration | Type: Duration

  4. Script:

(function execute(inputs, outputs) {
    // Calculate the difference between NOW and the Target Date
    // The result is automatically a Duration object
    outputs.wait_duration = gs.dateDiff(gs.nowDateTime(), inputs.target_date, false);
})(inputs, outputs);


Step 2: Configure the Wait

  1. Add the Wait for a duration logic.

  2. Do not manually type numbers (which have the 999 limit).

  3. Instead, drag the wait_duration data pill (from the Script step created above) directly into the Duration field.

Will it work for > 60 days? Yes. The 999-hour limit applies only to manual user input in the UI. When you pass a Duration Data Pill, the system accepts values of months or even years without issue.

If this solution helps you achieve the required wait logic, please mark it as Accepted Solution.

Best regards,
Brandão.

Hi

Does it still works if I configure in the following way?

 

Step 1: Configure the Wait

  1. Add the Wait for a duration of time logic.
  2. Choose Relative duration as Duration Type.
  3. Wait for 00 h, 00 min, 00 sec after data pill (user_date)

I don't use: Relative duration restriction: Set to 'Stay in-step until'

 

Will it work for > 60 days if user_date is 60 days after today?

 

Thanks 

Cristina

Hi

Does it still works if I configure in the following way?

 

Step 1: Configure the Wait

  1. Add the Wait for a duration of time logic.
  2. Choose Relative duration as Duration Type.
  3. Wait for 00 h, 00 min, 00 sec after data pill (user_date)

I don't use: Relative duration restriction: Set to 'Stay in-step until'

 

Will it work for > 60 days if user_date is 60 days after today?

 

Your sicerely

Cristina

 

cristinamat
Giga Contributor

Hi

Does it still works if I configure in the following way?

Step 1: Configure the Wait

  1. Add the Wait for a duration of time logic.
  2. Choose Relative duration as Duration Type.
  3. Wait for 00 h, 00 min, 00 sec after data pill (user_date)

I don't use: Relative duration restriction: Set to 'Stay in-step until'

 

Will it work for > 60 days if user_date is 60 days after today?

Thanks

Cristina