Learn

Add a workflow

Turn the steps you already run into one file any agent can follow.

View on GitHub

A workflow is up to ten steps, each naming one published tool, written as the result it reaches. These are the moves from an empty file to a merged pull request.

Note. Every step must name a tool that already exists and is published, or the build rejects the file.

How to create

  1. 1. Create one file, in a flat folder

    workflows/ has no subfolders. The file name is the key and the URL, and it never changes once published — a rename adds the old name under aliases and the old URL redirects.

    workflows/funding-signal-outbound.md
    workflows/at-risk-customer-rescue.md
    workflows/competitor-intent.md
  2. 3. Name what the agent must ask for

    Under ## Inputs, one line per input: its name in snake_case, in backticks, then what it is and, after “e.g.”, an example — so the agent can ask the user a clear question instead of guessing. Steps refer to inputs by the same name in backticks, never as {{templates}}.

    workflows/funding-signal-outbound.md
    ## Inputs
    
    - `target_segment`: the kind of company to watch, e.g. Series A B2B SaaS in the US
    - `campaign_id`: the lemlist campaign that sends the emails from your mailbox, e.g. cam_123; its email reads each lead's drafted text from a custom variable
  3. 4. Write one to ten steps

    Under ## Steps, a numbered list: the step’s title in bold, “with” the tool it uses — a published tool’s key, linked to its file — then what to do with it. Say what to do, not how the tool works: the tool’s own file already covers setup. The build links every step to its tool, and every tool page back to the workflows that use it.

    workflows/funding-signal-outbound.md
    ## Steps
    
    1. **Find funded companies** with [people-data-labs/search-companies](../companies/people-data-labs/tools/search-companies.md). List companies matching `target_segment` whose `last_funding_date` falls in the last 30 days, with `size` up to 100 and `scroll_token` for the next page. Keep name, domain, latest round and date.
    2. **Find the buyer** with [apollo/search-people](../companies/apollo/tools/search-people.md). For each company, find the head of growth or marketing; skip companies with no match.
    3. **Get their emails** with [apollo/bulk-enrich-people](../companies/apollo/tools/bulk-enrich-people.md). Enrich each buyer, up to 10 per call. Keep their name, title and work email.
    4. **Write emails** with [anthropic/create-message](../companies/anthropic/tools/create-message.md). Draft a three-sentence plain-text email per contact: congratulate the round, name one thing they will now have budget for, ask one question. Show the drafts to the user.
    5. **Send** with [lemlist/add-lead-to-campaign](../companies/lemlist/tools/add-lead-to-campaign.md). After the user approves, add each contact to `campaign_id` with their approved email as a custom variable.
  4. 5. Say when the job is done

    Under ## Done when, at least one check — the condition that means it finished. Do not write rules about asking before sending, spending or changing data: the rendered file adds those itself, last, and nobody can edit them.

    workflows/funding-signal-outbound.md
    ## Done when
    
    - Every funded company has a contact, or a note explaining why not.
    - Every approved contact is in the campaign, and the user has a summary table.
  5. 6. Check it locally

    One command parses every file, resolves every reference and renders the result. It reports every problem at once, each with the file that caused it (and the line, for a problem in the body). The same checks run again in CI on your pull request.

    pnpm install
    pnpm content:check
    pnpm dev   # then open /workflows/funding-signal-outbound
  6. 7. Open a pull request

    One company, tool or workflow per pull request keeps the review quick. Say what you added and how you checked the facts. Maintainers review for accuracy, not for style — the build owns style.