Quickstart

Minimal template with basic functions and workflow

Get Code

The quickstart template is the minimum viable AGNT5 project. It scaffolds a single durable function wrapped in a workflow so you can run, checkpoint, and replay a piece of code end-to-end in a few minutes. Use it as the “hello world” before reaching for agents.

What you’ll build

  • A single @function that performs a trivial unit of work (greeting a name)
  • A @workflow that invokes the function through ctx.step() so the call is checkpointed
  • A local dev server that executes, records, and replays every run
  • A project layout you can grow by adding more functions or a second workflow

Requirements

  • Python 3.10+
  • The AGNT5 CLI (instructions below)
  • No external API keys — this template does not call any LLM

Install

curl -LsSf https://agnt5.com/cli.sh | bash

Setup

Scaffold the project

agnt5 create quickstart my-first-app
cd my-first-app

Install dependencies

uv sync
python -m venv .venv
source .venv/bin/activate
pip install -e .

Start the dev server

agnt5 dev up

The dev server boots the gateway, engine, and coordinator locally, then registers your worker.

Invoke the workflow

agnt5 invoke greet_workflow --input '{"name": "Ada"}'

You should see the workflow return a greeting and a run id you can inspect in Studio.

How it works

The template defines one function decorated with @function and one workflow decorated with @workflow. When you invoke the workflow, AGNT5 records the input to the journal, starts execution, and treats each ctx.step() call as a checkpoint. If the worker crashes mid-run, replay reconstructs the state from the journal — already-completed steps return their cached results, and execution resumes at the next unfinished step.

There is no LLM call here on purpose. The point is to see the durable execution machinery — invoke, journal, replay — with nothing else in the way. Once this works, swapping the inner function for a real task (an HTTP call, a database write, a model request) is a one-line change.

Key files

  • worker.py — Registers the function and workflow with the AGNT5 worker SDK.
  • pyproject.toml — Python project metadata and the agnt5 dependency.
  • agnt5.toml — Project config consumed by the CLI (name, entrypoint, target env).

Customize

Swap the inner function. Replace the greeting logic with an HTTP fetch, an LLM call, or a database write. As long as you keep side effects inside ctx.step(), replay stays deterministic.

Add a second step. Chain two functions inside the workflow with two ctx.step() calls. Each becomes its own checkpoint and retries independently on failure. See /docs/build/workflows.

Tune retries. Pass a retry policy to ctx.step() to change max attempts and backoff. The default is sensible for idempotent work.

Next steps