Docs

Add a workflow

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

View on GitHub

A workflow is one to ten steps that reach a result. Each step uses one published tool and says what to do with it.

Note. Every step must name a published tool, or the check rejects the file.

How to create

  1. 1. Create the file

    Add one file to workflows/, which has no subfolders. The file name becomes the key and the URL. To rename it later, list the old name under aliases and the old URL redirects.

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

    Under ## Inputs, one line per input: its name in snake_case and backticks, a colon, then what it is. Add , e.g. and an example when it helps. Steps refer to an input 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 the steps

    Under ## Steps, a numbered list of one to ten steps: the step’s title in bold, “with” the tool it uses — a published tool’s key, linked to ../companies/<handle>/tools/<name>.md — a full stop, 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 it is done

    Under ## Done when, list at least one check that means the job is finished. Leave out safety rules such as asking before sending: every file ends with them automatically.

    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.

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

    Send one company, tool or workflow per pull request. Say what you added and how you checked the facts. Reviewers check accuracy; the build handles formatting.