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

# Run subflow

## `core.workflow.execute`

Execute a workflow by alias.

### Inputs

<ParamField path="workflow_alias" type="string | null" required>
  Alias of the subflow to execute. Must be provided.
</ParamField>

<ParamField path="batch_size" type="integer">
  Number of subflows to execute in parallel.

  Default: `32`.
</ParamField>

<ParamField path="environment" type="string | null">
  Subflow's target execution environment. This is used to isolate secrets across different environments.If not provided, the subflow's default environment is used.

  Default: `null`.
</ParamField>

<ParamField path="fail_strategy" type="string">
  Fail strategy to use when a subflow fails.

  Default: `"isolated"`.

  Allowed values: `isolated`, `all`.
</ParamField>

<ParamField path="loop_strategy" type="string">
  Execution strategy to use for the subflow.

  Default: `"batch"`.

  Allowed values: `parallel`, `batch`, `sequential`.
</ParamField>

<ParamField path="timeout" type="number | null">
  Maximum number of seconds to wait for the subflow to complete. If not provided, the subflow's default timeout is used.

  Default: `null`.
</ParamField>

<ParamField path="trigger_inputs" type="any | null">
  Inputs to pass to the subflow (arbitrary JSON).

  Default: `null`.
</ParamField>

<ParamField path="version" type="integer | null">
  Version of the subflow definition, if any.

  Default: `null`.
</ParamField>

<ParamField path="wait_strategy" type="string">
  Wait strategy to use when waiting for subflows to complete. In `wait` mode, this action will wait for all subflows to complete before returning. Any subflow failures will be reported as an error. In `detach` mode, this action will return immediately after the subflows are created. A failing subflow will not affect the parent.

  Default: `"detach"`.

  Allowed values: `wait`, `detach`.
</ParamField>

### Examples

**Run a subflow**

```yaml theme={null}
- ref: run_subflow
  action: core.workflow.execute
  args:
    workflow_alias: enrich_case
    trigger_inputs:
      case_id: ${{ TRIGGER.case_id }}
      severity: ${{ TRIGGER.severity }}
    wait_strategy: wait
    timeout: 300
```

## `core.workflow.get_status`

Get the status of a workflow execution.

### Inputs

<ParamField path="wf_exec_id" type="string" required>
  The workflow execution ID to check.
</ParamField>

### Examples

**Check an execution**

```yaml theme={null}
- ref: launch_subflow
  action: core.workflow.execute
  args:
    workflow_alias: collect_evidence
    trigger_inputs:
      case_id: ${{ TRIGGER.case_id }}
- ref: subflow_status
  action: core.workflow.get_status
  depends_on:
    - launch_subflow
  args:
    wf_exec_id: ${{ ACTIONS.launch_subflow.result.wf_exec_id }}
```
