Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MotiaDev/motia/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Steps are the core building blocks of Motia applications. They define handlers that respond to triggers like HTTP requests, queue messages, cron schedules, state changes, or stream events.Function: step
Step configuration object or dictionary containing:
name(str): Unique step nametriggers(list): List of trigger configurationsenqueues(list): Optional list of topics to enqueuedescription(str): Optional descriptionflows(list[str]): Optional flow associationsinfrastructure(InfrastructureConfig): Optional resource config
Optional async handler function. If provided, returns a
StepDefinition. If omitted, returns a StepBuilder.Returns
StepDefinition if handler is provided, otherwise StepBuilder for chaining.Class: StepBuilder
Builder pattern for creating step definitions.Methods
handle
Async function that handles the step execution.
Complete step definition with config and handler.
Class: StepDefinition
A complete step definition containing both configuration and handler.Attributes
The step configuration.
The async handler function.
Type: StepConfig
Fields
Unique identifier for the step.
List of trigger configurations (API, queue, cron, state, or stream).
Topics to enqueue to. Can be topic names (strings) or
Enqueue objects with label and conditional settings.Virtual enqueue topics for visualization without actual enqueue calls.
Virtual subscriptions for visualization purposes.
Human-readable description of the step.
Flow names this step belongs to.
Additional files to include in deployment.
Resource configuration for handler and queue settings.
Type: InfrastructureConfig
Fields
Handler resource configuration:
ram(int): Memory in MB (default: 128)cpu(int): CPU units (optional)timeout(int): Timeout in seconds (default: 30)
Queue configuration:
type(“fifo” | “standard”): Queue type (default: “standard”)max_retries(int): Maximum retry attempts (default: 3)visibility_timeout(int): Visibility timeout in seconds (default: 30)delay_seconds(int): Delay before processing (default: 0)