# Operation State

| Parameter           | Description                                                                         | Type              | Required                             |
| ------------------- | ----------------------------------------------------------------------------------- | ----------------- | ------------------------------------ |
| name                | Unique State name. Must follow the Serverless Workflow Naming Convention            | string            | yes                                  |
| type                | State type                                                                          | string            | yes                                  |
| actionMode          | Should actions be performed sequentially or in parallel. Default is `sequential`    | enum              | no                                   |
| actions             | Actions to be performed                                                             | array             | yes                                  |
| timeouts            | State specific timeout settings                                                     | object            | no                                   |
| stateDataFilter     | State data filter                                                                   | object            | no                                   |
| onErrors            | States error handling and retries definitions                                       | array             | no                                   |
| transition          | Next transition of the workflow after all the actions have been performed           | string or object  | yes (if `end` is not defined)        |
| compensatedBy       | Unique name of a workflow state which is responsible for compensation of this state | string            | no                                   |
| usedForCompensation | If `true`, this state is used to compensate another state. Default is `false`       | boolean           | no                                   |
| metadata            | Metadata information                                                                | object            | no                                   |
| end                 | Is this state an end state                                                          | boolean or object | yes (if `transition` is not defined) |

<details>

<summary><strong>Click to view example definition</strong></summary>

</details>

**Example:**

<table><thead><tr><th>JSON</th><th>YAML</th></tr></thead><tbody><tr><td><pre class="language-json"><code class="lang-json">{
    "name": "reject-application",
    "type": "operation",
    "actionMode": "sequential",
    "actions": [
        {
            "functionRef": {
                "refName": "send-rejection-email-function",
                "arguments": {
                    "customer": "${ .customer }"
                }
            }
        }
    ],
    "end": true
}
</code></pre></td><td><pre class="language-yaml"><code class="lang-yaml">name: reject-application
type: operation
actionMode: sequential
actions:
- functionRef:
    refName: send-rejection-email-function
    arguments:
      customer: "${ .customer }"
end: true
</code></pre></td></tr></tbody></table>

Operation state defines a set of actions to be performed in sequence or in parallel. Once all actions have been performed, a transition to another state can occur.

The `timeouts` property can be used to define state specific timeout settings. Operation states can define the `stateExecTimeout` and `actionExecTimeout` settings. For more information on Workflow timeouts reference the Workflow Timeouts section.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.a4b.vn/xflow/developer-guide/workflow-states-reference/operation-state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
