Skip to main content

Examples

View as Markdown

Each example is a complete application built with Dex. A design pattern shows one technique; an example combines several. The Quick Start runs Customer Refund. Then read Order Processing. For agents, start with the Order Support Agent.

Examples

AI agents

ExampleWhat it doesShowsSDKs
Sign-up Review AgentReviews each new sign-up with admins in Slack, applies their decision, and sends the welcome email after approval and a send replyAgent sessions, Connectors as Tools, a Connector Trigger, a wait of days for a person, Time TravelTypeScript, Go, own repository
Release Watch AgentPosts a digest of your dependencies' new releases to Slack on weekdays, and files GitHub issues for the releases your team chooses to trackCron schedule, Decision with Deadline, agent sessions, a Connector Trigger, an outbox in an AttributeTypeScript, own repository
Order Support AgentLooks up and cancels orders, built once for each agent framework; every cancellation waits for approvalTool calls, Approvals, Sessions, Connectors as ToolsPython, TypeScript, Go

Workflows

ExampleWhat it doesShowsSDKs
Order ProcessingCharges a buyer, waits for the seller to approve the shipment, then ships, or refunds when shipping keeps failingReminder, Execute Failure Recovery, Wait for Step CompletionAll five
Subscription and Billing LifecycleRuns a subscription through its trial, billing periods, price changes, and cancellationRecurring Timer loop, Static Parallel StepsAll five
User Onboarding ProcessVerifies a new user's email, then waits for two setup tasks in order and sends remindersReminderAll five
Money TransferMoves money between two accounts, and attempts compensation when an operation still fails after its retriesExecute Failure RecoveryAll five
Job Seeker EngagementKeeps an employer and a job seeker aligned while the job seeker decides on an opportunityStatic Parallel Steps, Reminder, Decision with Deadline, Wait for Attribute MatchAll five
Deal DSLDescribes each deal as data and runs any deal in one FlowWorkflow DSLAll five
Microservice OrchestrationCalls up to four APIs, two in parallel, one after a callback or a 24-hour timeoutStatic Parallel Steps, Decision with DeadlineAll five
Job PostingStores a searchable job posting and delivers every update to LinkedIn and Indeed in orderEntity Flow, Wait for Attribute MatchAll five
Customer RefundChecks a refund request, waits for a manager on large amounts, issues the refund, and emails the customerA manager approval through a Channel and RPCs, Dex Web Actions, idempotency keys, Time TravelAll five; two more Flows in Go only

"All five" means Python, Go, TypeScript, Java, and Rust. Build AI Agents has one more example: the AI Agent (Python, TypeScript), a general agent on the Dex Agent Framework.

Run any example

Run an example from the playground starts the examples of one language and the playground. The playground has every example above except Deal DSL and the three agents; their pages show how to run them.