Examples catalog

The examples/ directory holds runnable samples grouped by concern. Each category below lists what it demonstrates, primary SDK or surface, and whether a README exists in the tree.

Use this catalog to pick a starting point before reading tutorial tracks.

Index by category

DirectoryDemonstratesPrimary surfaceREADME
examples/static/Static site production patterns (Relay + published workflows)Static SDK, Relay, adminREADME
examples/static/chat-rag/Landing-page support chat with RAGStatic SDK, RelayStatic chat widget walkthrough
examples/static/online-application-chatbot/Multi-turn intake + external callbackStatic SDK, Relay, externalREADME
examples/graph/DAG routing, joins, parallel fan-out, ReAct-style agentsPython SDKnone (see scripts below)
examples/rag/Vector memory, document QAPython SDKnone
examples/hitl/Interrupt and approve flowsPython SDKnone
examples/streaming/SDK stream iteratorsPython + TypeScriptnone
examples/external/Webhook callbacks, Playwright stubPython SDK, servernone
examples/relay/byo-docker/Self-hosted RelayRelay, DockerREADME
examples/langchain/LangChain / LangGraph interopPython SDK (arcflow.langchain)none
examples/education/Domain vertical: course QAPython SDKnone
examples/healthcare/Domain vertical: protocol QAPython SDKnone
examples/personal/Domain vertical: blog pipelinePython SDKnone
examples/support/Domain vertical: ticket RAG botPython SDKnone
examples/trading/Domain vertical: research RAG tradePython SDKnone

Static product examples

Production static-site path: dashboard owns agents, memory, and knowledge; frontend calls runPublished() through Relay.

ExampleUse caseFrontend responsibility
chat-ragLanding-page support chat~30 lines: env vars + chat UI
online-application-chatbotMulti-turn intake with external stepRelay + published workflow ref

Operator setup flow (from static README):

  1. Dashboard: create site, copy relay URL and site token
  2. Dashboard: upload knowledge, configure chat, publish workflow
  3. Frontend: set VITE_ARCFLOW_RELAY_URL and VITE_ARCFLOW_SITE_TOKEN
  4. Deploy to CDN; no server-side app code required

Advanced local-only path: chat-rag/src/main-dev-direct.ts (direct runtime key; not for production).

Graph workflows

ScriptPattern
react_agent.pyReAct-style tool loop in graph
reflection_loop.pyConditional reflection routing
parallel_search.pyParallel branches and join

Requires Workflow(graph=True) and Postgres for recovery-heavy paths. Graph resume from checkpoint remains partial (Graph recovery resume).

RAG and memory

ScriptPattern
document_qa.pyIngest + query with vector memory

Prerequisites: Qdrant (ARCFLOW_QDRANT_URL), embedding provider env vars. Verify MemoryRetrieved events in trace.

Human-in-the-loop

ScriptPattern
expense_approval.pyStep interrupt, approve/reject

Requires enable_recovery() and Postgres. Server path supports approve API when not using in-process SDK only.

Streaming

ScriptLanguage
chat_stream.pyPython run_stream()
chat_stream.tsTypeScript runStream()

In-process SDK streaming only. Server SSE is deferred (streaming deferred).

External callbacks

ScriptPattern
playwright_stub_callback.pyPosts external outcome to server callback

Pair with ExternalBindingConfig on publish and report_outcome() from Python. See server HMAC requirements in published contract pages.

Relay

ExamplePattern
byo-dockerSelf-hosted Relay with Docker Compose

Browser env: VITE_ARCFLOW_RELAY_URL, VITE_ARCFLOW_SITE_TOKEN. Relay validates Origin and rate-limits per site.

LangChain interop

ScriptPattern
migration_demo.pyfrom_langchain_tool, langgraph_to_arcflow

Requires Python optional [langchain] extra. No TypeScript equivalent in repo.

Vertical samples

Domain-specific agent workflows (Python). Useful as copy sources, not separate product surfaces:

DirectoryFocus
education/Course Q&A
healthcare/Protocol Q&A
personal/Blog content pipeline
support/Ticket RAG bot
trading/Research + RAG trade flow

Each is a single-script sample without a dedicated README. Run from repo root with SDK built and provider keys set.

VS Code extension examples

PathContent
extensions/vscode-arcflow/examples/Workflow preview JSON for extension dev

Separate from top-level examples/; targets extension authors.

How to run (general)

  1. Build the SDK for your language (Python install or TypeScript install)
  2. Export provider and backend env vars the sample needs
  3. Run the script from repository root, e.g. python examples/rag/document_qa.py

Static examples use npm install and npm run dev inside the example directory.

Gaps in example coverage

TopicStatus
TypeScript graph sample in examples/graph/Python only today
TypeScript RAG samplePython only; TS has VectorStore but no dedicated example README
Server-only curl tutorialsSee Track B: Server API, not duplicated here
Per-example READMEOnly static and relay categories have README files today

Contributors adding examples should include a README with prerequisites, env vars, and a verify command per Example catalog.

Branch note (pending merges)

Documentation and lessons may reference names from branches not yet on main:

Current branch pathAfter feat/examples-catalog-restructure
examples/rag/document_qa.pyexamples/rag/memory_guide_qa.py (ingest + query in one script)
examples/personal/blog_pipeline.pyexamples/personal/weekly_blog_pipeline.py
examples/external/playwright_stub_callback.pyexamples/external/portal_outcome_callback.py
examples/langchain/migration_demo.pyexamples/langchain/langchain_adapter_demo.py

Lessons under getting-started/rag/ call out both names where relevant. After merge, update this table and remove dual references.

SDK PascalCase facades (CommonTools, FromLangChain, ExternalOutcome) are documented in getting-started/tools/ with legacy import notes until feat/sdk-pascalcase-facades merges.