---
sourceDocument: Brazil Build workflows
sourceDocumentLink: https://www.servicenow.com/docs/r/build-workflows

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Build workflows

ft:clusterId :

    - crworkflow

bundleId :

    - crworkflow

workflow :

    - Creator


---

# Publish a system event for an unexpected state

# Publish a system event for an unexpected state {#ariaid-title1}

Release version: Brazil  
Updated September 30, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
Publish a system event when a flow enters the error, cancelled, or presumed interrupted states. Use the default event name or specify a custom event name.

## Before you begin

Role required: flow_designer, flow_operator, or flow_admin

## Procedure

1. Navigate to AllProcess AutomationFlow AdministrationSettings..
2. Select New.
3. From Flow/SubFlow/Action, select Flow.
4. From Document, select the flow that you want to publish a system event for when it enters an unexpected state.  
5. Expand the section Flow Execution State Events.
6. Select the flow states where you want to publish a system event.  
   {#publish-a-system-event-when-a-flow-has-an-unexpected-state__table_p53_wrh_rkc__entry__2}

   | Field | Description |
   |-|-|
   | Publish error events | Publish a system event when a flow enters the Error state. |
   | Publish cancellation events | Publish a system event when a flow enter the Cancelled state. |
   | Published presumed interrupted events | Publish a system event when a flow enters the Presumed Interrupted state. |
   [ ]

   {#publish-a-system-event-when-a-flow-has-an-unexpected-state__table_p53_wrh_rkc}
7. **Optional:** In Event name, enter a custom event name.  
   These are the default system event names.
   * flow.state.error
   * flow.state.cancelled
   * flow.state.interrupted
   {#publish-a-system-event-when-a-flow-has-an-unexpected-state__ul_aly_lsh_rkc}
8. Select Submit.

## Result

Workflow Studio publishes the appropriate system event when the flow enters the specified unexpected state of error, cancelled, or presumed interrupted. You can review the Parm2
field of the system event to see a JSON payload describing the flow context.

    {
      "contextId": "abc123...",
      "flowId": "def456...",
      "flowName": "My Automated Flow",
      "previousState": "IN_PROGRESS",
      "currentState": "ERROR",
      "errorMessage": "Connection timeout",
      "cancellationReason": "",
      "runTimeMs": 1542,
      "engineMajorVersion": 2,
      "domainId": "global",
      "createdBy": "admin",
      "callingSource": "flow_trigger"
    }

## What to do next

Register the system event. For more information about registering a system event, see [Register an event](https://www.servicenow.com/docs/TV4O8e~lreyBaPz3NZ7oQQ "You can register an event for a specific table and a business rule that fires the event."). After the system event is registered, you can create a script action or a notification to automate the response to the event. For more information about script actions, see [Script actions](https://www.servicenow.com/docs/YW9cd7rD82FUiMSqFdsT6Q "You can use script actions to create server-side scripts that perform a variety of tasks, such as modifying a configuration item (CI), or managing failed login attempts. Script actions are triggered by events only.").

*[\>]: and then


