> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sarasfinance.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute Process Workflow

> Trigger the execution of an agentic workflow on a specific business process.

### Body Parameters

<ParamField body="subProjectId" type="string" placeholder="sp_123" required>
  The unique identifier for the sub-project.
</ParamField>

<ParamField body="processId" type="string" placeholder="proc_123" required>
  The unique identifier for the process.
</ParamField>

<ParamField body="stageKey" type="string" placeholder="stage_init" required>
  The key identifying the stage where this workflow is configured.
</ParamField>

<ParamField body="workflowId" type="string" placeholder="wf_123" required>
  The unique ID of the workflow to execute.
</ParamField>

<ParamField body="otherDetails" type="object">
  Optional custom metadata and extra contextual options to start the workflow run.
</ParamField>

### Response

<ResponseField name="runId" type="object">
  <Expandable title="properties">
    <ResponseField name="id" type="string">
      The unique identifier for the workflow run created.
    </ResponseField>

    <ResponseField name="state" type="string">
      The initial state of the workflow run (e.g. `RACING`, `COMPLETED`, `PAUSED`).
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash theme={null}
  curl --location 'https://api.sarasfinance.com/v1/process/workflows/executeWorkflow' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <token>' \
  --data '{
      "subProjectId": "93d599a6-a396-4ef6-b30e-aff95c56c523",
      "processId": "ef341826-1cab-4680-aa52-efd001f9da00",
      "stageKey": "stage_init",
      "workflowId": "wf_b2a7590d"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "runId": {
      "id": "run_017b2c9a",
      "state": "RACING"
    }
  }
  ```
</ResponseExample>

### Error Codes

| Code                                       | ID   | Description                                                     |
| :----------------------------------------- | :--- | :-------------------------------------------------------------- |
| `ERROR_PROCESS_META_IS_MISSING_IN_REQUEST` | 1200 | Metadata missing in request (e.g., `processId` or `workflowId`) |
| `ERROR_PROCESS_DOES_NOT_EXIST`             | 1239 | The specified process ID was not found                          |
| `ERROR_SUBPROCESS_META_NOT_FOUND`          | 1202 | Sub-project metadata not found                                  |
| `ERROR_NOT_ALLOWED_TO_CALL_METHOD`         | 1209 | User unauthorized to execute workflows                          |
