Workflow - Sleep Action Best Practices

Are there any limits to how sleep can be used, such as maximum lengths of time, or other best practices that should be observed when using sleep? For example, could sleep be used to schedule the deletion of an account after 90 days past a trigger event?

Hi @adunker! I’m curious about your use case(s) for the Sleep Action.

  1. What are typical time segments (for Sleep) you envision using in your workflows?
  2. What types of time limits (for Sleep) would you expect?

Hi @kevin_chang, I’m really just trying to imagine the art of the possible and what we can support from business requests. Perhaps it’s to create a certification 5-7 days after a department or manager changes from the Identity Attribute Change Event or I think commonly additional actions or notifications that are often requested as part of the termination process that could be anywhere from 30-180 days after such as additional account actions or legal hold. For minutes/hours, I could imagine scheduled workflows that would wait to adjust to a user’s timezone before taking action or sending notifications or waiting for downstream applications, or perhaps provisioning events that need to happen in a specific ordered process for some reason.

From the description on sleep: “The length of time to pause the workflow. Use s to represent seconds and m to represent minutes.” is it safe to infer that we’re not working with time periods of days? It seemed to accept 10080m as a valid input and is currently executing.

Turns out there are definitely limits:

type timestamp activity
ActivityTaskScheduled 2022-04-20T19:30:57.235277974Z {input:{duration:10080m},task:sp:sleep}
ActivityTaskStarted 2022-04-20T19:30:57.266709984Z {}
ActivityTaskTimedOut 2022-04-20T19:35:57.239809338Z {}
WorkflowTaskScheduled 2022-04-20T19:35:57.23982711Z {}
WorkflowTaskStarted 2022-04-20T19:35:57.264930864Z {}
WorkflowTaskCompleted 2022-04-20T19:35:57.293070442Z {}
WorkflowExecutionFailed 2022-04-20T19:35:57.293117461Z {error:actionStep(Sleep) Error: task failed: activity error (type: sp:internal:sleep, scheduledEventID: 5, startedEventID: 6, identity: ): activity timeout (type: ScheduleToClose)}

It would be useful to know what current caps are set at.