Skip to content
Open the app

A pack's own switch ​

A param is a value a workflow reads in its steps, declared under params in its file. This page builds one switch end to end: a mode param with the options interactive and autonomous, from the workflow file to the rule that sets it. Each step links the page that holds the full rule.

1. Declare the param ​

In your pack's workflow, declare mode in the long form with its options and a default. The description is what a request reads, so it names the words that mean each option. metadata.role makes it an agent workflow, so a playbook step of that role can run it (Workflows).

yaml
id: se_work_ticket
title: "SE: work a ticket"
description: "Implement a ticket and open a pull request"
metadata:
  agent: true
  role: se
params:
  ticket_url:
    type: string
    description: "The ticket's URL"
  mode:
    type: string
    default: interactive
    description: "How the agent works. autonomous: when the request says unattended, overnight, no questions or autonomous. interactive: anything else."
    options: [interactive, autonomous]
  hint:
    type: string
    default: ""
    description: "Optional extra instructions for the agent"
  entry_path:
    type: string
    default: "~/workspace"
    description: "Working directory for the agent"
steps:
  - type: terminal.open
    title: "Agent: SE"
    cwd: "{{entry_path}}"
  - type: terminal.run
    cmd: |
      claude "$(cat <<'SB_PROMPT'
      read the ticket {{ticket_url}} with all its comments, implement it and open a pull request.
      Work in {{mode}} mode: in interactive mode stop and ask in a ticket comment when a decision is not yours, in autonomous mode decide yourself and say what you decided in the pull request.
      Extra instructions: {{hint}}
      SB_PROMPT
      )"

The file passes the workflow check. A default outside the list, one option, or an option with a space fails it with the line and column: Parameters.

2. Read it in the prompt ​

mode sits inside a sentence of the agent's prompt, in the heredoc whose closing word is quoted. It never stands alone on a line and never appears in a command outside the prompt, because a person sets its value: Where a param may go.

Once the pack syncs, the workflow's page shows mode with its default and its options, and the Run dialog shows it as a choice with interactive selected: Workflows.

3. The playbook lists it ​

Build a playbook with this workflow as its SE step, here Work a ticket (work-a-ticket). A playbook whose steps run this workflow lists mode on its page under Inputs: optional, with its options and its default, and the step that reads it. Two steps that declare mode with different options get a warning: Inputs.

4. Set it by hand, by the API or by the MCP ​

By hand. Run a playbook shows mode under the playbook's inputs as Default · interactive. Pick autonomous and start: Start a run.

By the API. Pass the value in params. A value that is not listed, or a playbook whose steps do not read mode, is refused with 400 invalid_request: Tasks.

bash
curl -X POST https://app.kadmo.ai/api/v1/tasks/ENG-12/runs \
  -H "Authorization: Bearer $KADMO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"playbook":"work-a-ticket","params":{"mode":"autonomous"}}'

By the MCP. The tools that start a workflow or work on a task take a params argument: MCP tools.

5. Say it in a request ​

In Slack, Teams or a Jira comment, Ada writes "work on ENG-12 overnight, no questions". The deciding step reads mode's description and takes autonomous; in Jira, a rule that confirms first names it in its question as With mode: autonomous. A request that names no option leaves mode out, so the default interactive stands. Only a listed value is ever kept: The decision.

6. Set it by a rule ​

A Jira rule on Label added autonomous that pins Work a ticket can set mode to autonomous in the fields under its hint. Every start by the rule passes it, at once or through Tasks. Saving a value that is not listed is refused: A rule's params.

7. Check the run ​

The run page shows a Params row with mode autonomous, and each step's job holds the value in its input. A run started with no value shows no row, and its steps take the default interactive. An input that a step's workflow declares with no default is required, and with no value the row says No value: NAME (required): The run page.