# Gleam aion_flow SDK

Find typed workflow, activity, codec, signal, query, child and testing APIs.

The Gleam aion_flow SDK authors typed workflows for the Erlang target. Aion runs their BEAM bytecode through beamr. Keep external effects in activities and use the SDK’s recorded operations for time and randomness.

## Install and package

The [Gleam getting-started guide](/aion/getting-started/gleam/) creates and packages a project. [Hex](https://hex.pm/packages/aion_flow) publishes version 0.7.0; [HexDocs](https://aion-flow.hexdocs.pm/) describes that release. The APIs here follow the authorized main checkout, whose package also reports 0.7.0.

- `aion/workflow`: Workflow definition and entry adapter, recorded activity/time/random operations, concurrency, timers, signals, children, continuation and iteration.
- `aion/activity`: Typed activity values, codecs, retry policy, timeouts, heartbeat, labels, queues, nodes and execution tiers.
- `aion/codec`: JSON encoding/decoding pair and DecodeError. null_codec represents a no-argument query document.
- `aion/signal, aion/query`: Typed signal references, send and receive; read-only query handlers and dispatch.
- `aion/child, aion/duration`: Typed child handles and result decoding; explicit time units.
- `aion/error, aion/agent`: Typed errors at execution boundaries and the shared agent outcome codec.
- `aion/manifest, aion/testing`: Activity declaration manifest and deterministic workflow test environment.


## Define the entry

Define a typed function returning a success or error value. Supply codecs for input, output and workflow error to the workflow definition. The engine-facing entry adapter accepts the raw JSON text argument and returns encoded JSON text for success or failure.

The package descriptor names that entry function. Build the Gleam project before packaging its Erlang output.

## API reference

[Workflow API](/aion/reference/gleam-workflow-api/)

Definitions, activity execution, recorded values, timers, concurrency and children.
[Activity API](/aion/reference/gleam-activity-api/)

Contracts, retry policies, queue and node selection, codecs and declarations.
[Supporting APIs](/aion/reference/gleam-support-api/)

Signals, queries, child handles, duration, errors, agents, manifests and tests.

On main, gleam/aion_flow/src/aion_flow.gleam:1–38 names the public modules. Their function declarations define the APIs in the linked reference pages. Use the matching checkout’s package and compiler when building a workflow.
