1. Reference
  2. Python API
import avalanche as ava

Each group links to the page that explains it.

​
Workflows

See Workflows.

NameWhat it is
ava.workflow(fn=None, *, cron, webhook, input, key, output, emits, context, agent_defaults, classifier_defaults)Declares a workflow
ava.WorkflowA built workflow. .run(...), .test(...), .key(input)
ava.inputThe run input, or one field: ava.input.field
a >> b, a & bThen, and side by side
ava.Webhook(path=None)A webhook with a chosen path
ava.RunHandleA started run: .result(), .done(), .cancel(), .exception()
ava.LocalExecutor(max_workers=None)Runs steps on this machine; the default

​
Python steps

See Python steps.

NameWhat it is
ava.step(fn=None, *, num_returns=1, slug=None, retries=7, on_uncertain="retry", emits=(), integrations=())A step
ava.source(...), ava.dest(...)The same, named for bringing data in and sending it out
ava.transformAnother name for ava.step
ava.BaseInput, ava.BaseContextBase classes for a run’s input and caller context
ava.RunContextrun_id, workflow_name, node_slug, metadata, step_key
ava.Logger()A logger for the step, used as a parameter default
ava.File, ava.WorkspaceA file and a folder. See Inputs and files.

​
Agent steps

See Agent steps.

NameWhat it is
ava.agent_step(signature, *, runtime=None, tools=(), skills=(), integrations=(), evaluations=None, retries=7, on_uncertain="retry")An agent step with a function body
ava.agent.step(signature, inputs=None, slug=None, ...)An agent step declared inside a workflow
ava.agent.step.map(signature, *items, ...)One agent per item
ava.Signature, ava.InputField, ava.OutputFieldThe agent’s contract
ava.AgentThe injected agent. await agent(**inputs)
ava.agent.AgentResult.outputs, .trace
ava.agent.AgentTrace.header, .turns
ava.agent.SkillA skill. Skill.from_dir(path)
ava.agent.AgentDefaultsThe typed form of agent_defaults
ava.agent.AgentStepError, AgentStepCallError, AgentStepExecutionError, AgentOutputErrorAgent step errors

​
Runtimes

See Runtimes.

NameWhat it is
ava.runtimes.PredictRLM(lm, sub_lm, max_iterations=30, max_llm_calls=50, skills, allowed_domains, ...)The default runtime
ava.runtimes.ClaudeAgent(model, max_turns, builtin_tools, permission_mode, system_prompt_append, system_prompt_preset, max_budget_usd, narrate=True)Claude
ava.runtimes.OpenAIAgent(model, max_turns, builtin_tools, system_prompt_append, narrate=True, tracing=False)OpenAI
ava.runtimes.predict_rlm.skills.pdf, .docx, .spreadsheetPredictRLM’s document skills

​
Evaluations

See Evaluations.

NameWhat it is
ava.Evaluations(metrics, composites, classifier, model, timeout)The evaluations of one agent step
ava.Metric(*, state, question)One question about the step’s output
ava.EvalContextWhat a metric sees: inputs, output, trace

​
Classifier steps

See Classifier steps.

NameWhat it is
ava.classifier_step(*, questions=None, input_model=None, classifier=None, model=None, timeout=None, slug=None, retries=7, on_uncertain="retry")A classifier step
ava.ClassifierThe injected classifier. await classifier(state=..., questions=None)
ava.ClassificationResult.choices, .nouls, .scores, .answers, .model, .usage
ava.classifiers.TypeSafe(), OpenAIDecisions(), GeminiDecision()The providers
ava.ClassifierStepError, ava.ClassifierStepExecutionErrorClassifier step errors

​
State machines

See State machines.

NameWhat it is
ava.machine(*, input, key, cron=None, webhook=None)Declares a state machine
ava.state(work, *, initial=False, final=False, defer=())A state
state.on(name, *, payload=None) >> targetA transition on an event
state.after(delay) >> targetA transition on a timer
ava.event(name, output), ava.EventAn event returned by a step; the base class of decision outcomes
ava.MachineA built machine. .send(...), .key(input), .test(input)

​
Orchestration

See Control flow, Retries, Waits and Approvals.

NameWhat it is
step.map(*items, max_items=None, fail_fast=True, **shared)Run a step once per item
ava.DEFAULT_MAX_ITEMS, ava.HARD_CAP8 and 64
ava.MapItemsFailed, ava.MapItemFailureRaised when map items fail
ava.skip(reason=None), ava.StepSkippedEnd a step as skipped
ava.call(target, input=None, *, timeout=None, when=True)Run another workflow and wait for its result
ava.start_run(target, input=None, *, when=True), ava.RunStartStart another workflow without waiting
ava.NonRetryableErrorFail a step without retrying
ava.OutcomeUnknownErrorReport that an action may or may not have happened
ava.Rerun(run_id, start, mode="autorun")Describes a rerun from given steps
ava.sleep(duration=None, *, until=None, slug=None)Wait for time
ava.wait_for_event(model, *, key, timeout, slug=None)Wait for an event
ava.decision(outcome, *, prompt, timeout, show=None, on_timeout=None, assignees=None, approvers=None, slug=None)Wait for a person
ava.decision.map(outcome, items, *, prompt, timeout, ...)One decision per item

​
Integrations

See Integrations.

NameWhat it is
ava.ConnectorBase class for your own API
ava.toolMarks a connector method as a tool
ava.ApiKey(header, prefix=""), ava.OAuth2(*, authorize_url, token_url, scopes=(), ...)How a connector signs in
ava.ClientThe HTTP client behind self.client
ava.MCP(name, *, url=None, command=None, allow=None, ...)An MCP server

​
For platform builders

Names used to run Avalanche inside another system. Most projects never touch them.

NameWhat it is
ava.Executor, ava.get_default_executorThe executor interface
ava.ExecutionServices, ExecutionServicesSpec, ExecutionTaskSpec, ExecutionServiceReceipt, EXECUTION_SERVICES_V1Hooks around each step’s execution
ava.ReferenceBinder, LocalReferenceBinder, rebind_arguments, file_reference_contextHow file references are resolved
ava.MachineHost, MachineInstance, MachineEventReceiptThe host side of state machines
ava.PROTOCOL_VERSION, ava.ProtocolVersionThe SDK’s protocol version
ava.JsonMarks a model field as JSON