# StepOptions
[EN] Source: https://mastra.ai/reference/legacyWorkflows/step-options

Configuration options for workflow steps that control variable mapping, execution conditions, and other runtime behavior.

## Usage

```typescript
workflow.step(processOrder, {
  variables: {
    orderId: { step: "trigger", path: "id" },
    userId: { step: "auth", path: "user.id" },
  },
  when: {
    ref: { step: "auth", path: "status" },
    query: { $eq: "authenticated" },
  },
});
```

## Properties

<PropertiesTable
  content={[
    {
      name: "variables",
      type: "Record<string, VariableRef>",
      description: "Maps step input variables to values from other steps",
      isOptional: true,
    },
    {
      name: "when",
      type: "StepCondition",
      description: "Condition that must be met for step execution",
      isOptional: true,
    },
  ]}
/>

### VariableRef

<PropertiesTable
  content={[
    {
      name: "step",
      type: "string | Step | { id: string }",
      description: "Source step for the variable value",
      isOptional: false,
    },
    {
      name: "path",
      type: "string",
      description: "Path to the value in the step's output",
      isOptional: false,
    },
  ]}
/>

## Related

- [Path Comparison](/docs/workflows-legacy/control-flow)
- [Step Function Reference](./step-function)
- [Step Class Reference](./step-class)
- [Workflow Class Reference](./workflow)
- [Control Flow Guide](/docs/workflows-legacy/control-flow)


---
title: "Reference: Step Retries | Legacy Workflows"
description: "Automatically retry failed steps in Mastra workflows with configurable retry policies."
---