Workflow Builder
The Workflow Builder generates a workflow configuration from a natural language description. You can edit the result before saving.
Overview
The builder is an iterative process:
- Describe what you want your workflow to do
- Review the generated configuration
- Iterate with feedback until it’s right
- Test with a dry run
- Create the workflow when satisfied
Prompt vs code workflows
The builder can create two types:
Prompt-based workflows
The default type. You describe behavior in natural language, and the AI decides how to execute it at runtime.
Best for:
- Flexible, adaptive behavior
- Simple single-purpose tasks
- Situations where “do what makes sense” is appropriate
Example: “When I receive a newsletter, archive it and add the ‘newsletters’ label”
Code workflows
For deterministic, multi-step processes. The builder generates TypeScript code that runs in a sandbox.
Best for:
- Complex orchestration with multiple steps
- Precise formatting requirements
- Aggregating data from multiple sources before acting
- When you need the same inputs to always produce the same outputs
Example: “Every morning at 8 AM, gather all unread emails, group them by sender, and send me a summary with counts per sender”
The builder writes code for you. When you describe a code workflow, it generates, tests, and iterates on the TypeScript automatically. You don’t need to write any code yourself.
The builder automatically chooses the right type based on your description, or you can explicitly request one: “Create a code workflow that…”
Getting started
Access the builder
- Go to Workflows in Town
- In the composer at the top, type what you want your workflow to do
- Press Enter to launch the builder
Or navigate directly to /workflows/wizard.
Describe your workflow
Describe behavior in natural language. Include triggers and actions:
Good examples:
- “I want a workflow that monitors my inbox for bill notifications and extracts due dates and amounts”
- “Create a workflow that sends me a weekly digest of all newsletters I received”
- “Build a workflow that watches for GitHub PR review requests and reminds me after 24 hours”
Less helpful:
- “Make an email workflow” (too vague)
- “Handle my inbox” (what specifically?)
Include frequency (cron), trigger type (incoming email vs schedule vs forwarding), and actions (label/archive/send summary).
The builder interface
The builder has two main panels:
Chat panel (right)
Use the chat to refine the configuration:
- Your messages and requests
- The builder’s responses and explanations
- Tool calls showing configuration changes
Config preview (left)
A live preview of the workflow configuration:
- Name — Workflow’s display name
- Description — What the workflow does
- Logic — Instructions or code
- Triggers — When the workflow runs
- Tools — What actions it can take
- Mode — Autonomous, approval-required, or read-only
The preview updates as you accept changes.
Iterating on configuration
After the initial generation:
Give feedback
Tell the builder what to change:
- “Make it run at 8 AM instead of 6 AM”
- “Add the ability to search the web”
- “Change the mode to require approval for sending emails”
- “The prompt should also consider emails from last week”
Accept or discard changes
When the builder proposes changes, you can:
- Accept Changes — Apply the new configuration
- Discard — Revert to the previous version
Edit directly
Click the edit button on the config panel to modify settings directly:
- Toggle tools on/off
- Adjust trigger settings
- Edit the prompt or code
- Change the mode
Testing your workflow
Before saving, you can run a test (dry run):
How test runs work
- Click Test on the config panel
- Select which Gmail account to use (if you have multiple)
- The builder creates a temporary workflow and runs it
- Results appear in the Test Results tab
What you see
The test results show:
- Status — Running, completed, or failed
- Actions — Every action the workflow would take
- Reasoning — Decision trace (if enabled)
Test runs are dry runs — no actual changes are made to your emails. The workflow simulates what it would do without actually doing it.
Iterate based on results
After reviewing test results, you can:
- Chat with the builder: “The workflow is archiving too aggressively, only archive newsletters”
- Adjust the configuration directly
- Run another test
Creating the workflow
When you’re satisfied with the configuration:
- Review all settings one final time
- Click Create Workflow
- The workflow is created and enabled
You’ll be redirected to the workflow’s detail page where you can:
- Monitor runs
- Adjust settings
- Enable/disable the workflow
- View run history
Builder capabilities
The builder can configure all aspects of a workflow:
Triggers
- Incoming email (every new email)
- Email to assistant (forward/CC to yourname@town.com)
- Schedule (cron expressions)
- Manual
Tools
The builder can enable tools based on your description. You can remove tools you don’t want the workflow to use.
Modes
- Autonomous (acts without approval)
- Approval-required (requires approval for write actions)
- Read-only (no modifications)
Advanced
- MCP servers (if configured)
- Custom prompts with detailed instructions
Tips for best results
Start narrow. Add tools and edge cases after you see failures in a test run.
Be specific about edge cases. Tell the builder how to handle unusual situations: “If an email is both a newsletter and from a known contact, keep it in inbox.”
Use test runs. Iterate until tool calls and actions match your intent.
Review the logic. Treat it as code: check constraints, edge cases, and output format.
Example session
You: I want a workflow that watches for receipts and invoices, extracts the amount and vendor, and adds them to a “receipts” label.
Builder: Draft configuration:
- Triggers on every incoming email
- Looks for receipts and invoices
- Extracts vendor and amount
- Adds the “receipts” label
[Shows generated config with name, prompt, triggers, tools]
You: Also archive them after labeling.
Builder: Updated! The workflow will now archive emails after adding the receipts label.
[Config updates to include archive_email tool]
You: Let’s test it.
[Click Test — Results show the workflow would label and archive 2 receipts from the last day]
You: Looks good, create it.
[Click Create Workflow — Workflow is created and enabled]
Related
- Manual Configuration — Configure workflows without the builder
- Concepts — Technical deep-dives on code workflows
- Reference — Details on triggers, tools, and prompts