Quickstart: Temporal Workflow API Starter
Get up and running with the Temporal Workflow API Starter in minutes.
Prerequisites
- Python 3.15 (
requires-python = ">=3.15,<3.16"inpyproject.toml) uvpackage managerjustcommand runner- Docker and Docker Compose
- A reachable Temporal server (
temporal server start-devfor local development)
Installation
-
Clone the repository:
git clone https://github.com/boozallen/temporal-workflow-api-starter.gitcd temporal-workflow-api-starter -
Install dependencies and create
.envfromenv.template:just setupThis runs
uv sync --group dev --group test, copiesenv.templateto.envif it does not already exist, and locks the dependency set withuv lock. -
Review and customize
.env, in particularAPI_AUTH_TOKEN:uv run python -c "import secrets; print(secrets.token_urlsafe(32))"The API is fail-closed: it rejects every
/workflows/*request whileAPI_AUTH_TOKENis unset.
Running Locally
Start an external Temporal server, then run the API with autoreload:
temporal server start-dev
just dev
just dev runs uv run uvicorn src.main:app --host 127.0.0.1 --port 8000 --reload.
just dev connects to TEMPORAL_HOST from .env, localhost:7233 from env.template,
where temporal server start-dev listens. compose.yaml sets host.docker.internal:7233
for the API container instead.
Verify It Works
Visit http://localhost:8000/docs for the interactive Swagger UI, or check the health
endpoint directly:
macOS, Linux and WSL:
curl http://localhost:8000/health
Windows PowerShell:
curl.exe http://localhost:8000/health
To start a test workflow, include the bearer token from your .env:
macOS, Linux and WSL:
curl -X POST http://localhost:8000/workflows/start \
-H "Authorization: Bearer <your-api-auth-token>" \
-H "Content-Type: application/json" \
-d '{"workflow_type": "MyWorkflow", "input_data": {"message": "Hello World"}}'
Windows PowerShell:
$body = @{ workflow_type = "MyWorkflow"; input_data = @{ message = "Hello World" } } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri http://localhost:8000/workflows/start -Headers @{ Authorization = "Bearer <your-api-auth-token>" } -ContentType "application/json" -Body $body
Next Steps
- Return to the Temporal Workflow API Starter overview for architecture details
- See the API Endpoints Reference for every endpoint