React to a Case Deadline¶
Goal¶
Start a focused follow-up workflow when a case reaches its deadline.
What You Will Learn¶
- configure an Event Listener Module for
Case.Deadline - use the event as a workflow starting point
- route overdue cases to a review task without polling
Difficulty and Estimated Time¶
- Difficulty: Intermediate
- Estimated time: 20 minutes plus the selected deadline interval
Assumed Knowledge¶
You should be familiar with case deadlines, module tasks, actions, routes, and task assignment.
Required Reading¶
Prerequisites¶
- a case-enabled test channel
- permission to create and commit a process
- a test identity that can receive the follow-up task
Steps¶
Create the Deadline Listener¶
- Add an Event Listener Module to a new process.
- Set Event Name to
Case.Deadline. - Configure the listener as a starting point.
- Connect its first action to a user task named
Review Overdue Case. - Assign that task to a test group that can access the case channel.
The event payload is available through $Input, while $Case represents the case whose deadline was reached. An empty handle script selects the first available action, which is sufficient for this example.
Trigger the Event¶
- Create a test case.
- Set its deadline a few minutes in the future.
- Wait for the deadline worker to process the case.
How It Works¶
The case deadline worker marks the deadline as reached and emits Case.Deadline. The listener starts one workflow instance for that event and routes it to the review task. No scheduled polling process is required.
Verify the Result¶
Confirm that one Review Overdue Case work item is created and that it is associated with the expected case. Change the deadline before it expires and confirm that the old date does not create a follow-up task.
Failure and Edge Cases¶
- Deadline processing is asynchronous, so the task may not appear at the exact deadline second.
- A missing task assignee can leave the new workflow without an actionable owner.
- Repeated deadline changes require a duplicate-handling policy appropriate to the process.
Security and Portability Notes¶
- Case events are processed in the case domain; preserve channel visibility and tenant boundaries.
- Keep the listener short because an exception rolls back the event transaction.
- Do not copy case or channel identifiers between environments.