Delaying and scheduling workflows
Corteza workflow allows you to schedule or delay its execution. This can be a powerful tool when working with external services that throttle their API usage or when we want to perform some task in an interval, such as monthly subscription renewal.
To achieve this, we provide a delay step and a deferred trigger .
The delay step allows you to explicitly pause the workflows' execution for a set period of time.
This type of delaying is common when working with APIs that throttle their access. To examplify; let’s say that the API allows 10 calls per minute and we wish to fetch 100 items. We could do something like the following:
If you want to wait for an action performed by a user (such as a confirmation), use a prompt step instead.
An interval trigger allows you to run the workflow in the specified interval. This can be used to perform routine daily tasks, or process larger data in batches.
A good example is a subscription service where it is necessary to renew the subscriptions of the clients once a month. We define an interval that would execute the workflow each day, determine what clients need to be renewed that day and renew them.
An interval is defined by specifying the resource as a system, and the event as an interval in the trigger configuration (click on the configuration icon ).
Common cron examples:
A timestamped trigger allows you to run the workflow at the specified time.
To illustrate; we’ve just received a new client that requested a series of deadlines where they would like to see the current progress. We could define a scheduled workflow that is executed at each one of the timestamps. The workflow would aggregate all of the completed tickets into an email and send it off to the client.
Timestamps are defined in the ISO 8601,
Corteza workflows' execution does not timeout by default (the workflow can run indefinitely).
If your use-case requires you to define a timeout, you can implement this manually.
Schedule a timeout after 10sec of execution,
Repeat the iterator indefinitely.