improved

Business Process scheduling and expiration

The schedule, expiration, status, and callback properties of a business process have more capabilities around being updated. These new features are available while updating or creating a business process.

Update Examples

Here are a couple of examples to help get the creative juices flowing.

{
 "callback": "https://app.example.com/callback",
 "expiration": 1729319125987 
}
{
 "status": "in-progress",
 "expiration": 1729319125987 
}
{
 "schedule": 1729319125987 
}
{
"schedule": "5d", // business process publish, after 5 days from current time  
"expiration": "48h" // expiration will be after 2 days from schedule time.
}

Status

📘

Not available for closed business processes

These properties cannot be modified once the business process is failed or resolved.

  • The status can be changed from scheduled to in-progress but not vice-versa. Changing it to in-progress will cause the business process to execute immediately (there may be up to a 10-minute delay).
  • You can continue to change a business process from in-progress to either resolved or failed.

Schedule

  • You can only update the schedule property if the business process is not in-progress, meaning the businessProcess.status must be scheduled.
  • scheduled can be updated to allow duration like (5d or 48h) d = day, h = hour or a point in time (timestamp).
  • You cannot pass a timestamp that's in the past. It must be greater than the current time; otherwise, an error will be returned.
  • You cannot pass a timestamp after the expiration date provided. It must be greater than the current time but lesser than the expiration time; otherwise, an error will be returned.
  • You cannot pass a timestamp or duration greater than 365 days from the current time or business process createdOn time.
  • scheduled allows you to zero out or put any time within 10 minutes of the current time (after the current time) to cause the event to be executed immediately. Otherwise, it will continue executing using the existing logic, which will execute within 20 minutes of the defined time.

Expiration

  • expiration can be updated to allow duration like (5dor48h) d = day, h = hour or a point in time (timestamp).
  • You cannot pass a timestamp that's in the past. It must be greater than the current time, or an error will occur.
  • You cannot pass a timestamp before the scheduledtime if business process status is scheduled. It must be greater than the current time or scheduled time if it exists; otherwise, an error will be returned.
  • You cannot pass a timestamp or duration greater than 365 days from the current time or business process createdOn time or scheduled time if it exists.
  • expiration allows you to zero out or put any time within 10 minutes of the current time (after the current time) if business process status is in-progress, to cause the event to be executed immediately. Otherwise, it will continue executing using the existing logic, which will execute within 20 minutes of the defined time.