documentation/dsls/DSL:-Ash.Flow.cheatmd

<!--
This file was generated by Spark. Do not edit it by hand.
-->
# DSL: Ash.Flow.Dsl

The built in flow DSL.

## Halting

Steps can be halted, which will stop the flow from continuing and return a halted flow. To attach a specific reason, use a `halt_reason`.
If you need more complex halting logic, then you'd want to use a custom step, and return `{:error, Ash.Error.Flow.Halted.exception(...)}`


## flow
Details about the flow itself, like description and the successful return type.


### Nested DSLs
 * [argument](#flow-argument)





### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="flow-api" href="#flow-api">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        api
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">module</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    An api to use by default when calling actions
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="flow-description" href="#flow-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description of the flow
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="flow-trace_name" href="#flow-trace_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        trace_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name to use when creating traces. Defaults to the short name.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="flow-short_name" href="#flow-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A short name to use for the flow. Defaults to the last to parts of the module name, underscored.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="flow-returns" href="#flow-returns">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        returns
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The step or step that should constitute the return value.

  </td>
</tr>

  </tbody>
</table>



## flow.argument
```elixir
argument name, type
```


An argument to be passed into the flow




### Examples
```
argument :params, :map do
  default %{}
end

```

```
argument :retries, :integer do
  allow_nil? false
end

```




### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-type-name" href="#name-type-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name to use for the argument
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-type-type" href="#name-type-type">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        type
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">module</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The type of the argument. See `Ash.Type` for more.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-type-default" href="#name-type-default">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        default
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">(-> any) | mfa | any()</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A default value to use for the argument if not provided
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-type-allow_nil?" href="#name-type-allow_nil?">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        allow_nil?
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">boolean</code>
  </td>
  <td style="text-align: left">
    <code class="inline">true</code>
  </td>
  <td style="text-align: left" colspan=2>
    Whether or not the argument value may be nil
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-type-constraints" href="#name-type-constraints">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        constraints
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">Keyword.t</code>
  </td>
  <td style="text-align: left">
    <code class="inline">[]</code>
  </td>
  <td style="text-align: left" colspan=2>
    Constraints to provide to the type when casting the value. See the type's documentation for more information.
  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Argument`




## steps
The steps to run.


### Nested DSLs
 * [map](#steps-map)

 * [branch](#steps-branch)

 * [transaction](#steps-transaction)

 * [create](#steps-create)
 * [debug](#steps-debug)
 * [update](#steps-update)
 * [destroy](#steps-destroy)
 * [validate](#steps-validate)
 * [read](#steps-read)
 * [run_flow](#steps-run_flow)
 * [custom](#steps-custom)


### Examples
```
steps do
  # invokes a create action
  create :create_post, MyApp.Post, :create
end

```




## steps.map
```elixir
map name, over
```


Runs a set of steps for each item in a provided list.




### Examples
```
map :create_users, range(1, arg(:count)) do
  output :create_user

  create :create_user, Org, :create do
    input %{
      first_name: {Faker.Person, :first_name, []},
      last_name: {Faker.Person, :last_name, []}
    }
  end
end

```




### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-over-name" href="#name-over-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name of the step. Will be used when expressing dependencies, and step inputs.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-over-over" href="#name-over-over">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        over
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The value to be iterated over. Will be available inside the `map` step as `element(:map_step_name)`
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-over-output" href="#name-over-output">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        output
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Which step to use when constructing the output list. Defaults to the last step.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-over-short_name" href="#name-over-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Set a short name for the step. Will be used when building things like mermaid charts.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-over-wait_for" href="#name-over-wait_for">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        wait_for
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Ensures that the step happens after the configured step or steps. This is a template who's results are not used, only awaited.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-over-touches_resources" href="#name-over-touches_resources">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        touches_resources
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(atom)</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A list of resources touched by any custom logic in this step. This is used in the case that this step is run in a transaction. This is primarily only needed for `custom` steps.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-over-halt_if" href="#name-over-halt_if">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_if
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Halts the step by emitting an error (with an `Ash.Error.Flow.Halted`). Can use template variables. See the section on Halting for more.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-over-halt_reason" href="#name-over-halt_reason">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_reason
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    <code class="inline">:halted</code>
  </td>
  <td style="text-align: left" colspan=2>
    Configures the reason for the `halt_if` clause.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-over-description" href="#name-over-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description for the step.

  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Step.Map`

## steps.branch
```elixir
branch name, condition
```


Runs a set of steps based on a given value.




### Examples
```
branch :create_users, result(:create_users?) do
  output :create_user

  create :create_user, Org, :create do
    input %{
      first_name: {Faker.Person, :first_name, []},
      last_name: {Faker.Person, :last_name, []}
    }
  end
end

```




### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-condition-name" href="#name-condition-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name of the step. Will be used when expressing dependencies, and step inputs.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-condition-condition" href="#name-condition-condition">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        condition
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A template that must evaluate to `true` for the branch to be executed.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-condition-output" href="#name-condition-output">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        output
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Which step to use as the output. Defaults to the last step.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-condition-short_name" href="#name-condition-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Set a short name for the step. Will be used when building things like mermaid charts.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-condition-wait_for" href="#name-condition-wait_for">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        wait_for
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Ensures that the step happens after the configured step or steps. This is a template who's results are not used, only awaited.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-condition-touches_resources" href="#name-condition-touches_resources">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        touches_resources
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(atom)</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A list of resources touched by any custom logic in this step. This is used in the case that this step is run in a transaction. This is primarily only needed for `custom` steps.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-condition-halt_if" href="#name-condition-halt_if">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_if
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Halts the step by emitting an error (with an `Ash.Error.Flow.Halted`). Can use template variables. See the section on Halting for more.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-condition-halt_reason" href="#name-condition-halt_reason">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_reason
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    <code class="inline">:halted</code>
  </td>
  <td style="text-align: left" colspan=2>
    Configures the reason for the `halt_if` clause.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-condition-description" href="#name-condition-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description for the step.

  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Step.Branch`

## steps.transaction
```elixir
transaction name, resource
```


Runs a set of steps in a transaction.




### Examples
```
transaction :create_users do
  create :create_user, User, :create do
    input %{
      first_name: {Faker.Person, :first_name, []},
      last_name: {Faker.Person, :last_name, []}
    }
  end

  create :create_user, Org, :create do
    input %{
      first_name: {Faker.Person, :first_name, []},
      last_name: {Faker.Person, :last_name, []}
    }
  end
end

```




### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-resource-name" href="#name-resource-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name of the step. Will be used when expressing dependencies, and step inputs.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-output" href="#name-resource-output">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        output
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Which step or steps to use when constructing the output. Defaults to the last step.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-timeout" href="#name-resource-timeout">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        timeout
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">timeout</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A timeout to apply to the transaction.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-resource" href="#name-resource-resource">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        resource
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(module) | module</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The Ash resource to use for the transaction.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-short_name" href="#name-resource-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Set a short name for the step. Will be used when building things like mermaid charts.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-wait_for" href="#name-resource-wait_for">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        wait_for
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Ensures that the step happens after the configured step or steps. This is a template who's results are not used, only awaited.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-touches_resources" href="#name-resource-touches_resources">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        touches_resources
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(atom)</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A list of resources touched by any custom logic in this step. This is used in the case that this step is run in a transaction. This is primarily only needed for `custom` steps.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-halt_if" href="#name-resource-halt_if">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_if
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Halts the step by emitting an error (with an `Ash.Error.Flow.Halted`). Can use template variables. See the section on Halting for more.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-halt_reason" href="#name-resource-halt_reason">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_reason
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    <code class="inline">:halted</code>
  </td>
  <td style="text-align: left" colspan=2>
    Configures the reason for the `halt_if` clause.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-description" href="#name-resource-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description for the step.

  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Step.Transaction`

## steps.create
```elixir
create name, resource, action
```


Declares a step that will call a create action on a resource.




### Examples
```
create :create_post, MyApp.Post, :create

```




### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-resource-action-name" href="#name-resource-action-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name of the step. Will be used when expressing dependencies, and step inputs.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-resource" href="#name-resource-action-resource">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        resource
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The resource to call the action on.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-action" href="#name-resource-action-action">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        action
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The action to call on the resource.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-upsert?" href="#name-resource-action-upsert?">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        upsert?
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">boolean</code>
  </td>
  <td style="text-align: left">
    <code class="inline">false</code>
  </td>
  <td style="text-align: left" colspan=2>
    Wether or not this action is always an upsert.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-upsert_identity" href="#name-resource-action-upsert_identity">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        upsert_identity
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The identity to use for the upsert.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-short_name" href="#name-resource-action-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Set a short name for the step. Will be used when building things like mermaid charts.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-wait_for" href="#name-resource-action-wait_for">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        wait_for
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Ensures that the step happens after the configured step or steps. This is a template who's results are not used, only awaited.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-touches_resources" href="#name-resource-action-touches_resources">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        touches_resources
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(atom)</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A list of resources touched by any custom logic in this step. This is used in the case that this step is run in a transaction. This is primarily only needed for `custom` steps.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-halt_if" href="#name-resource-action-halt_if">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_if
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Halts the step by emitting an error (with an `Ash.Error.Flow.Halted`). Can use template variables. See the section on Halting for more.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-halt_reason" href="#name-resource-action-halt_reason">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_reason
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    <code class="inline">:halted</code>
  </td>
  <td style="text-align: left" colspan=2>
    Configures the reason for the `halt_if` clause.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-description" href="#name-resource-action-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description for the step.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-api" href="#name-resource-action-api">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        api
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The api to use when calling the action. Defaults to the api set in the `flow` section.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-tenant" href="#name-resource-action-tenant">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        tenant
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A tenant to use for the operation. May be a template or a literal value.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-input" href="#name-resource-action-input">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        input
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A template for the input.

  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Step.Create`

## steps.debug
```elixir
debug name
```


Declares a step that will inspect its input and provide
additional debug information.




### Examples
```
debug :show_some_information do
  input %{post: result(:create_post)}
end

```




### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-name" href="#name-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name of the step. Will be used when expressing dependencies, and step inputs.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-input" href="#name-input">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        input
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A template for the input.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-short_name" href="#name-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Set a short name for the step. Will be used when building things like mermaid charts.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-wait_for" href="#name-wait_for">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        wait_for
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Ensures that the step happens after the configured step or steps. This is a template who's results are not used, only awaited.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-halt_if" href="#name-halt_if">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_if
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Halts the step by emitting an error (with an `Ash.Error.Flow.Halted`). Can use template variables. See the section on Halting for more.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-halt_reason" href="#name-halt_reason">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_reason
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    <code class="inline">:halted</code>
  </td>
  <td style="text-align: left" colspan=2>
    Configures the reason for the `halt_if` clause.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-description" href="#name-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description for the step.

  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Step.Debug`

## steps.update
```elixir
update name, resource, action
```


Declares a step that will call a update action on a resource.




### Examples
```
update :update_post, MyApp.Post, :update do
  record result(:get_post)
end

```




### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-resource-action-record" href="#name-resource-action-record">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        record
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The record to be updated, can use template helpers, e.g `result(:step_name)`.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-name" href="#name-resource-action-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name of the step. Will be used when expressing dependencies, and step inputs.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-resource" href="#name-resource-action-resource">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        resource
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The resource to call the action on.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-action" href="#name-resource-action-action">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        action
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The action to call on the resource.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-short_name" href="#name-resource-action-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Set a short name for the step. Will be used when building things like mermaid charts.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-wait_for" href="#name-resource-action-wait_for">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        wait_for
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Ensures that the step happens after the configured step or steps. This is a template who's results are not used, only awaited.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-touches_resources" href="#name-resource-action-touches_resources">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        touches_resources
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(atom)</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A list of resources touched by any custom logic in this step. This is used in the case that this step is run in a transaction. This is primarily only needed for `custom` steps.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-halt_if" href="#name-resource-action-halt_if">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_if
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Halts the step by emitting an error (with an `Ash.Error.Flow.Halted`). Can use template variables. See the section on Halting for more.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-halt_reason" href="#name-resource-action-halt_reason">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_reason
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    <code class="inline">:halted</code>
  </td>
  <td style="text-align: left" colspan=2>
    Configures the reason for the `halt_if` clause.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-description" href="#name-resource-action-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description for the step.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-api" href="#name-resource-action-api">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        api
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The api to use when calling the action. Defaults to the api set in the `flow` section.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-tenant" href="#name-resource-action-tenant">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        tenant
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A tenant to use for the operation. May be a template or a literal value.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-input" href="#name-resource-action-input">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        input
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A template for the input.

  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Step.Update`

## steps.destroy
```elixir
destroy name, resource, action
```


Declares a step that will call a destroy action on a resource.




### Examples
```
destroy :destroy_post, MyApp.Post, :destroy

```




### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-resource-action-record" href="#name-resource-action-record">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        record
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The record to be updated, can use template helpers, e.g `result(:step_name)`.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-name" href="#name-resource-action-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name of the step. Will be used when expressing dependencies, and step inputs.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-resource" href="#name-resource-action-resource">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        resource
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The resource to call the action on.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-action" href="#name-resource-action-action">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        action
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The action to call on the resource.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-short_name" href="#name-resource-action-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Set a short name for the step. Will be used when building things like mermaid charts.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-wait_for" href="#name-resource-action-wait_for">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        wait_for
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Ensures that the step happens after the configured step or steps. This is a template who's results are not used, only awaited.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-touches_resources" href="#name-resource-action-touches_resources">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        touches_resources
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(atom)</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A list of resources touched by any custom logic in this step. This is used in the case that this step is run in a transaction. This is primarily only needed for `custom` steps.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-halt_if" href="#name-resource-action-halt_if">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_if
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Halts the step by emitting an error (with an `Ash.Error.Flow.Halted`). Can use template variables. See the section on Halting for more.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-halt_reason" href="#name-resource-action-halt_reason">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_reason
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    <code class="inline">:halted</code>
  </td>
  <td style="text-align: left" colspan=2>
    Configures the reason for the `halt_if` clause.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-description" href="#name-resource-action-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description for the step.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-api" href="#name-resource-action-api">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        api
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The api to use when calling the action. Defaults to the api set in the `flow` section.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-tenant" href="#name-resource-action-tenant">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        tenant
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A tenant to use for the operation. May be a template or a literal value.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-input" href="#name-resource-action-input">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        input
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A template for the input.

  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Step.Destroy`

## steps.validate
```elixir
validate name, resource, action
```


Validates some input against an action.




### Examples
```
validate :update_post, MyApp.Post, :update do
  record result(:get_post)
  only_keys [:name]
end

```




### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-resource-action-name" href="#name-resource-action-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name of the step. Will be used when expressing dependencies, and step inputs.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-resource" href="#name-resource-action-resource">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        resource
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The resource to call the action on.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-action" href="#name-resource-action-action">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        action
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The action to call on the resource.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-record" href="#name-resource-action-record">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        record
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The record to be created/updated/destroyed. If the value is `nil` and would be required by the action type, the step is skipped and `nil` is the result of the step.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-only_keys" href="#name-resource-action-only_keys">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        only_keys
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(list(atom) | atom)</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A list of keys or paths to keys that should be validated. Others will be ignored, and errors generated for other fields will be ignored.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-short_name" href="#name-resource-action-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Set a short name for the step. Will be used when building things like mermaid charts.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-wait_for" href="#name-resource-action-wait_for">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        wait_for
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Ensures that the step happens after the configured step or steps. This is a template who's results are not used, only awaited.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-touches_resources" href="#name-resource-action-touches_resources">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        touches_resources
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(atom)</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A list of resources touched by any custom logic in this step. This is used in the case that this step is run in a transaction. This is primarily only needed for `custom` steps.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-halt_if" href="#name-resource-action-halt_if">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_if
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Halts the step by emitting an error (with an `Ash.Error.Flow.Halted`). Can use template variables. See the section on Halting for more.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-halt_reason" href="#name-resource-action-halt_reason">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_reason
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    <code class="inline">:halted</code>
  </td>
  <td style="text-align: left" colspan=2>
    Configures the reason for the `halt_if` clause.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-description" href="#name-resource-action-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description for the step.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-api" href="#name-resource-action-api">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        api
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The api to use when calling the action. Defaults to the api set in the `flow` section.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-tenant" href="#name-resource-action-tenant">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        tenant
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A tenant to use for the operation. May be a template or a literal value.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-input" href="#name-resource-action-input">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        input
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A template for the input.

  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Step.Update`

## steps.read
```elixir
read name, resource, action
```


Declares a step that will call a read action on a resource.




### Examples
```
read :destroy_post, MyApp.Post, :destroy

```




### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-resource-action-name" href="#name-resource-action-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name of the step. Will be used when expressing dependencies, and step inputs.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-resource" href="#name-resource-action-resource">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        resource
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The resource to call the action on.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-action" href="#name-resource-action-action">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        action
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The action to call on the resource.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-get?" href="#name-resource-action-get?">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        get?
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">boolean</code>
  </td>
  <td style="text-align: left">
    <code class="inline">false</code>
  </td>
  <td style="text-align: left" colspan=2>
    Whether or not read action is expected to return a single result or `nil`. Set to `true` automatically if `get? true`.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-not_found_error?" href="#name-resource-action-not_found_error?">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        not_found_error?
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">boolean</code>
  </td>
  <td style="text-align: left">
    <code class="inline">true</code>
  </td>
  <td style="text-align: left" colspan=2>
    Whether or not finding no record should result in a not found error

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-short_name" href="#name-resource-action-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Set a short name for the step. Will be used when building things like mermaid charts.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-wait_for" href="#name-resource-action-wait_for">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        wait_for
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Ensures that the step happens after the configured step or steps. This is a template who's results are not used, only awaited.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-touches_resources" href="#name-resource-action-touches_resources">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        touches_resources
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(atom)</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A list of resources touched by any custom logic in this step. This is used in the case that this step is run in a transaction. This is primarily only needed for `custom` steps.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-halt_if" href="#name-resource-action-halt_if">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_if
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Halts the step by emitting an error (with an `Ash.Error.Flow.Halted`). Can use template variables. See the section on Halting for more.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-halt_reason" href="#name-resource-action-halt_reason">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_reason
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    <code class="inline">:halted</code>
  </td>
  <td style="text-align: left" colspan=2>
    Configures the reason for the `halt_if` clause.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-description" href="#name-resource-action-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description for the step.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-api" href="#name-resource-action-api">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        api
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The api to use when calling the action. Defaults to the api set in the `flow` section.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-tenant" href="#name-resource-action-tenant">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        tenant
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A tenant to use for the operation. May be a template or a literal value.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-resource-action-input" href="#name-resource-action-input">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        input
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A template for the input.

  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Step.Read`

## steps.run_flow
```elixir
run_flow name, flow
```


Runs another flow as part of the current flow.
The return value of the step is the return value of the flow.




### Examples
```
run_flow :get_org, GetOrgByName do
  input %{
    name: arg(:org_name)
  }

```




### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-flow-flow" href="#name-flow-flow">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        flow
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The flow to run.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-flow-name" href="#name-flow-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name of the step. Will be used when expressing dependencies, and step inputs.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-flow-input" href="#name-flow-input">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        input
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A template for the input.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-flow-short_name" href="#name-flow-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Set a short name for the step. Will be used when building things like mermaid charts.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-flow-wait_for" href="#name-flow-wait_for">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        wait_for
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Ensures that the step happens after the configured step or steps. This is a template who's results are not used, only awaited.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-flow-touches_resources" href="#name-flow-touches_resources">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        touches_resources
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(atom)</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A list of resources touched by any custom logic in this step. This is used in the case that this step is run in a transaction. This is primarily only needed for `custom` steps.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-flow-halt_if" href="#name-flow-halt_if">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_if
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Halts the step by emitting an error (with an `Ash.Error.Flow.Halted`). Can use template variables. See the section on Halting for more.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-flow-halt_reason" href="#name-flow-halt_reason">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_reason
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    <code class="inline">:halted</code>
  </td>
  <td style="text-align: left" colspan=2>
    Configures the reason for the `halt_if` clause.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-flow-description" href="#name-flow-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description for the step.

  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Step.RunFlow`

## steps.custom
```elixir
custom name, custom
```


Runs a custom step module.

See `Ash.Flow.Step` for the necessary callbacks and more information.




### Examples
```
custom :do_custom_thing, MyApp.DoCustomThing do
  input %{...}
end

```

```
custom :do_custom_thing, {MyApp.DoCustomThing, opt1: :foo, opt2: :bar} do
  input %{...}
end

```



### Arguments

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-custom-custom" href="#name-custom-custom">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        custom
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">(any, any -> any) | module</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The module that implements the step behaviour. Also accepts a 2 argument function that takes the input and the context.
  </td>
</tr>

  </tbody>
</table>
### Options

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default</th>
      <th colspan=2>Docs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
  <td style="text-align: left">
    <a id="name-custom-name" href="#name-custom-name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        name
      </span>
    </a>
      <sup style="color: red">*</sup>

  </td>
  <td style="text-align: left">
    <code class="inline">atom</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    The name of the step. Will be used when expressing dependencies, and step inputs.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-custom-input" href="#name-custom-input">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        input
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A template for the input.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-custom-async?" href="#name-custom-async?">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        async?
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">boolean</code>
  </td>
  <td style="text-align: left">
    <code class="inline">false</code>
  </td>
  <td style="text-align: left" colspan=2>
    Whether or not this step can be run outside of the current process.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-custom-short_name" href="#name-custom-short_name">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        short_name
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Set a short name for the step. Will be used when building things like mermaid charts.
  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-custom-wait_for" href="#name-custom-wait_for">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        wait_for
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Ensures that the step happens after the configured step or steps. This is a template who's results are not used, only awaited.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-custom-touches_resources" href="#name-custom-touches_resources">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        touches_resources
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">list(atom)</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A list of resources touched by any custom logic in this step. This is used in the case that this step is run in a transaction. This is primarily only needed for `custom` steps.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-custom-halt_if" href="#name-custom-halt_if">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_if
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    Halts the step by emitting an error (with an `Ash.Error.Flow.Halted`). Can use template variables. See the section on Halting for more.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-custom-halt_reason" href="#name-custom-halt_reason">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        halt_reason
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">`any`</code>
  </td>
  <td style="text-align: left">
    <code class="inline">:halted</code>
  </td>
  <td style="text-align: left" colspan=2>
    Configures the reason for the `halt_if` clause.

  </td>
</tr>

<tr>
  <td style="text-align: left">
    <a id="name-custom-description" href="#name-custom-description">
      <span style="font-family: Inconsolata, Menlo, Courier, monospace;">
        description
      </span>
    </a>
      
  </td>
  <td style="text-align: left">
    <code class="inline">String.t</code>
  </td>
  <td style="text-align: left">
    
  </td>
  <td style="text-align: left" colspan=2>
    A description for the step.

  </td>
</tr>

  </tbody>
</table>





### Introspection

Target: `Ash.Flow.Step.Custom`