Examples
Runnable Telo manifests showing common patterns. Each example is a complete
application. To run an example, install @telorun/cli,
and run telo <file-url> to execute it.
Top-level
AgentConsole
Interactive REPL backed by an Ai.Agent with tools. Each turn, the agent may call tools before answering:
- a regular HTTP tool (
get_weather) that fetches current weather from the open-meteo API via Http.Request, and - every tool exposed by the Telo registry MCP server at
https://registry.telo.run/mcp, discovered at runtime via AiMcp.ToolProvider.
The conversation is persisted in sqlite so each turn sees prior history and the
chat survives restart. Type
/exit(or send EOF) to leave.
Run with the OpenAI key in a sibling .env.local file:
OPENAI_API_KEY=sk-...
OPENAI_API_KEY='sk-your-openai-key' telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/agent-console.yaml
Open in Telo Editor → · View agent-console.yaml on GitHub →
ChatConsole
Interactive REPL chat with OpenAI streaming completions. Persists the
conversation in sqlite so each turn sees prior history and the chat survives
process restart. Delete the file to clear history. Type /exit (or
send EOF) to leave.
Run with the OpenAI key in a sibling .env.local file:
OPENAI_API_KEY=sk-...
The CLI loads .env.local from the manifest's directory automatically.
OPENAI_API_KEY='sk-your-openai-key' telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/chat-console.yaml
Open in Telo Editor → · View chat-console.yaml on GitHub →
ConfigurableHttpServer
HTTP server demonstrating how application-level variables (env-bound,
non-secret) and secrets flow into a JavaScript.Script handler at
runtime. The handler echoes the configured upstream URL and a masked
hint of the secret so you can verify both values made it end-to-end.
Set the inputs in a sibling .env.local:
API_BASE_URL=https://api.example.com
STRIPE_SECRET_KEY=sk_test_demo_value
Run, then:
curl -X POST http://localhost:4444/v1/charge
API_BASE_URL='https://api.example.com' STRIPE_SECRET_KEY='sk_test_your_stripe_key' telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/configurable-http-server.yaml
Open in Telo Editor → · View configurable-http-server.yaml on GitHub →
ConsoleInputExample
Reads two lines from stdin (username, password) and echoes them back via Console.writeLine.
Each step's result.value is wired into a later step's inputs via a
steps.
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/console-user-input.yaml
Open in Telo Editor → · View console-user-input.yaml on GitHub →
DrawShapesAgent
HTTP API where an AI vision agent draws shapes on a canvas and returns an S3 link.
OPENAI_API_KEY='sk-your-openai-key' S3_ACCESS_KEY_ID='your-secret-value' S3_SECRET_ACCESS_KEY='your-secret-value' telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/draw-shapes-agent.yaml
Open in Telo Editor → · View draw-shapes-agent.yaml on GitHub →
FeedbackApiRepo
Feedback REST API using SqlRepository — no SQL beyond the schema migration.
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/feedback-api-repo.yaml
Open in Telo Editor → · View feedback-api-repo.yaml on GitHub →
HelloApiExample
Simplest possible HTTP API: a single GET /v1/hello?name=… route backed
by a typed JS.Script. Shows how Http.Server mounts an Http.Api, how
the request schema feeds a CEL expression on inputs, and how the
script's output flows into the response body via result.*.
Run, then: curl 'http://localhost:8845/v1/hello?name=World'
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/hello-api.yaml
Open in Telo Editor → · View hello-api.yaml on GitHub →
HelloConsole
Smallest possible runnable Telo application: imports std/console and
prints a single line via a flat targets invoke step. Useful as a "does my setup work?"
smoke test and as a starting skeleton for larger script-style manifests.
Reach for Run.Sequence when a boot entry needs control flow, scopes, or
a return value.
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/hello-world.yaml
Open in Telo Editor → · View hello-world.yaml on GitHub →
JavaScriptDemo
A demo showcasing a JavaScript script run from flat targets.
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/javascript-demo.yaml
Open in Telo Editor → · View javascript-demo.yaml on GitHub →
StarlarkDemo
A demo showcasing a Starlark script run from flat targets.
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/starlark-basic.yaml
Open in Telo Editor → · View starlark-basic.yaml on GitHub →
templated-api-usage
Imports templated-api.yaml as a Telo.Library and mounts its
HelloApi twice on the same Http.Server — under /v1 and /v2.
Shows that a single library-defined kind can be reused across multiple
mount points without duplicating the route definition.
Run, then: curl 'http://localhost:8845/v1/hello?name=World' curl 'http://localhost:8845/v2/hello?name=World'
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/templated-api-usage.yaml
Open in Telo Editor → · View templated-api-usage.yaml on GitHub →
templated-server
Reusable Telo.Library that defines a single HelloApi (Http.Api) plus
the SayHello script it dispatches to. Importers receive HelloApi
under their chosen alias and can mount it on any Http.Server. Paired
with templated-api-usage.yaml, which mounts the same library twice
under /v1 and /v2 to show import + mount reuse.
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/templated-api.yaml
Open in Telo Editor → · View templated-api.yaml on GitHub →
WorkflowTemporalExample
Two-step durable workflow (fetch → transform) executed on a Temporal
backend. Shows how Workflow.Graph declares activity nodes that
dispatch to ordinary JS.Script resources, with per-node timeout and
retry policy.
Requires a running Temporal server at localhost:7233. The quickest
way to bring one up locally is:
docker run --rm -p 7233:7233 -p 8233:8233
temporalio/auto-setup:latest
Then run this manifest. The Temporal Web UI is available at
http://localhost:8233 to inspect the workflow execution.
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/workflow-temporal.yaml
Open in Telo Editor → · View workflow-temporal.yaml on GitHub →
AWS Lambda
Lambda-specific recipes. See the AWS Lambda example README for the deployment walkthrough.
lambda-direct-example
Lambda.Direct example: a synchronous AWS Lambda that receives a raw
event payload, maps it via CEL into a JS handler, and returns the
handler's result. Use this shape for SDK invokes, Step Functions
tasks, EventBridge Scheduler events, or any catch-all trigger that
isn't HTTP API or SQS. See examples/aws/lambda/README.md for the
full packaging + deploy walkthrough.
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/aws/lambda/direct.yaml
Open in Telo Editor → · View aws/lambda/direct.yaml on GitHub →
lambda-http-api-example
Lambda.HttpApi example: an AWS Lambda fronted by API Gateway HTTP API
v2. Declares two routes (GET /users/{id}, POST /orders) plus a CORS
block and a per-route catches: mapping that turns a thrown
ValidationError into a 400 with a structured body. See
examples/aws/lambda/README.md for the full packaging + deploy walkthrough.
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/aws/lambda/http-api.yaml
Open in Telo Editor → · View aws/lambda/http-api.yaml on GitHub →
lambda-multi-kind-example
Multi-kind AWS Lambda example: one Lambda artifact (one ARN, one IAM
role) wired up to three event sources at once — API Gateway HTTP API,
SQS event-source mapping, and direct SDK invokes. Telo dispatches each
incoming event to the matching Lambda.HttpApi / Lambda.Sqs /
Lambda.Direct handler based on the event shape. See
examples/aws/lambda/README.md for the full packaging + deploy walkthrough.
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/aws/lambda/multi-kind.yaml
Open in Telo Editor → · View aws/lambda/multi-kind.yaml on GitHub →
lambda-sqs-example
Lambda.Sqs example: an AWS Lambda triggered by an SQS event-source
mapping. The handler processes the message batch and uses
partialBatchResponse: true to report per-message failures via the
batchItemFailures shape, so AWS only retries the ones that actually
failed. See examples/aws/lambda/README.md for the full packaging +
deploy walkthrough.
telo https://raw.githubusercontent.com/telorun/telo/refs/heads/main/examples/aws/lambda/sqs.yaml
Open in Telo Editor → · View aws/lambda/sqs.yaml on GitHub →