<!--
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
```
### 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="flow-argument-name" href="#flow-argument-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="flow-argument-type" href="#flow-argument-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>
</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="flow-argument-default" href="#flow-argument-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="flow-argument-allow_nil?" href="#flow-argument-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="flow-argument-constraints" href="#flow-argument-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
```
### 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="steps-map-name" href="#steps-map-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="steps-map-over" href="#steps-map-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>
</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="steps-map-output" href="#steps-map-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="steps-map-short_name" href="#steps-map-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="steps-map-wait_for" href="#steps-map-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="steps-map-touches_resources" href="#steps-map-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="steps-map-halt_if" href="#steps-map-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="steps-map-halt_reason" href="#steps-map-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="steps-map-description" href="#steps-map-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
```
### 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="steps-branch-name" href="#steps-branch-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="steps-branch-condition" href="#steps-branch-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>
</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="steps-branch-output" href="#steps-branch-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="steps-branch-short_name" href="#steps-branch-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="steps-branch-wait_for" href="#steps-branch-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="steps-branch-touches_resources" href="#steps-branch-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="steps-branch-halt_if" href="#steps-branch-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="steps-branch-halt_reason" href="#steps-branch-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="steps-branch-description" href="#steps-branch-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
```
### 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="steps-transaction-name" href="#steps-transaction-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="steps-transaction-resource" href="#steps-transaction-resource">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
resource
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">module | list(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>
</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="steps-transaction-output" href="#steps-transaction-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="steps-transaction-timeout" href="#steps-transaction-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="steps-transaction-short_name" href="#steps-transaction-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="steps-transaction-wait_for" href="#steps-transaction-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="steps-transaction-touches_resources" href="#steps-transaction-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="steps-transaction-halt_if" href="#steps-transaction-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="steps-transaction-halt_reason" href="#steps-transaction-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="steps-transaction-description" href="#steps-transaction-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
```
### 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="steps-create-name" href="#steps-create-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="steps-create-resource" href="#steps-create-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="steps-create-action" href="#steps-create-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>
</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="steps-create-upsert?" href="#steps-create-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>
Whether or not this action is always an upsert.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="steps-create-upsert_identity" href="#steps-create-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="steps-create-short_name" href="#steps-create-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="steps-create-wait_for" href="#steps-create-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="steps-create-touches_resources" href="#steps-create-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="steps-create-halt_if" href="#steps-create-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="steps-create-halt_reason" href="#steps-create-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="steps-create-description" href="#steps-create-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="steps-create-api" href="#steps-create-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="steps-create-tenant" href="#steps-create-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="steps-create-input" href="#steps-create-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
```
### 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="steps-debug-name" href="#steps-debug-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>
</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="steps-debug-input" href="#steps-debug-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="steps-debug-short_name" href="#steps-debug-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="steps-debug-wait_for" href="#steps-debug-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="steps-debug-halt_if" href="#steps-debug-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="steps-debug-halt_reason" href="#steps-debug-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="steps-debug-description" href="#steps-debug-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
```
### 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="steps-update-name" href="#steps-update-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="steps-update-resource" href="#steps-update-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="steps-update-action" href="#steps-update-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>
</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="steps-update-record" href="#steps-update-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="steps-update-short_name" href="#steps-update-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="steps-update-wait_for" href="#steps-update-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="steps-update-touches_resources" href="#steps-update-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="steps-update-halt_if" href="#steps-update-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="steps-update-halt_reason" href="#steps-update-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="steps-update-description" href="#steps-update-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="steps-update-api" href="#steps-update-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="steps-update-tenant" href="#steps-update-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="steps-update-input" href="#steps-update-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
```
### 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="steps-destroy-name" href="#steps-destroy-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="steps-destroy-resource" href="#steps-destroy-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="steps-destroy-action" href="#steps-destroy-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>
</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="steps-destroy-record" href="#steps-destroy-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="steps-destroy-short_name" href="#steps-destroy-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="steps-destroy-wait_for" href="#steps-destroy-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="steps-destroy-touches_resources" href="#steps-destroy-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="steps-destroy-halt_if" href="#steps-destroy-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="steps-destroy-halt_reason" href="#steps-destroy-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="steps-destroy-description" href="#steps-destroy-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="steps-destroy-api" href="#steps-destroy-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="steps-destroy-tenant" href="#steps-destroy-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="steps-destroy-input" href="#steps-destroy-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
```
### 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="steps-validate-name" href="#steps-validate-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="steps-validate-resource" href="#steps-validate-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="steps-validate-action" href="#steps-validate-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>
</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="steps-validate-record" href="#steps-validate-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="steps-validate-only_keys" href="#steps-validate-only_keys">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
only_keys
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(atom | list(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="steps-validate-short_name" href="#steps-validate-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="steps-validate-wait_for" href="#steps-validate-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="steps-validate-touches_resources" href="#steps-validate-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="steps-validate-halt_if" href="#steps-validate-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="steps-validate-halt_reason" href="#steps-validate-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="steps-validate-description" href="#steps-validate-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="steps-validate-api" href="#steps-validate-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="steps-validate-tenant" href="#steps-validate-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="steps-validate-input" href="#steps-validate-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
```
### 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="steps-read-name" href="#steps-read-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="steps-read-resource" href="#steps-read-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="steps-read-action" href="#steps-read-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>
</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="steps-read-get?" href="#steps-read-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="steps-read-not_found_error?" href="#steps-read-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="steps-read-short_name" href="#steps-read-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="steps-read-wait_for" href="#steps-read-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="steps-read-touches_resources" href="#steps-read-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="steps-read-halt_if" href="#steps-read-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="steps-read-halt_reason" href="#steps-read-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="steps-read-description" href="#steps-read-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="steps-read-api" href="#steps-read-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="steps-read-tenant" href="#steps-read-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="steps-read-input" href="#steps-read-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)
}
```
### 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="steps-run_flow-name" href="#steps-run_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="steps-run_flow-flow" href="#steps-run_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>
</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="steps-run_flow-input" href="#steps-run_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="steps-run_flow-short_name" href="#steps-run_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="steps-run_flow-wait_for" href="#steps-run_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="steps-run_flow-touches_resources" href="#steps-run_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="steps-run_flow-halt_if" href="#steps-run_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="steps-run_flow-halt_reason" href="#steps-run_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="steps-run_flow-description" href="#steps-run_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="steps-custom-name" href="#steps-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="steps-custom-custom" href="#steps-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="steps-custom-input" href="#steps-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="steps-custom-async?" href="#steps-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="steps-custom-short_name" href="#steps-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="steps-custom-wait_for" href="#steps-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="steps-custom-touches_resources" href="#steps-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="steps-custom-halt_if" href="#steps-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="steps-custom-halt_reason" href="#steps-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="steps-custom-description" href="#steps-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`