Before you create one
Create a workflow when:- the task should run the same way every time
- you need Python code to execute the task
- the task needs structured inputs
- the task interacts with APIs, files, or external systems
How to create a workflow
- Open TeamCopilot.
- Go to the AI Assistant.
- Ask the assistant to create a workflow for a specific task.
- Be clear about the workflow’s purpose, inputs, and expected output.
- After the assistant creates it, open it from the Workflows tab.
- Review and edit the generated files.
- Declare any required secret keys and configuration.
- Have an engineer approve the workflow before running it in production.
What gets created
Each workflow lives in:.env or .env.example. For secrets, prefer TeamCopilot secret management rather than storing raw values in those files.
What each file does
workflow.json: defines the workflow contract, including its intent, inputs, and runtime timeoutREADME.md: documents what the workflow does and how it should be usedrun.py: contains the executable Python logicrequirements.txt: lists Python dependencies.venv/: contains the workflow’s isolated Python environmentrequirements.lock.txt: records the exact installed dependency versions
The most important file: workflow.json
workflow.json defines how TeamCopilot understands the workflow.
It includes:
intent_summary: a human-readable description of the workflowinputs: the parameters the workflow acceptsrequired_secrets: the secret keys TeamCopilot must resolve before the workflow can runtriggers.manual: whether it can be run manuallyruntime.timeout_seconds: how long it can run before timing out
Writing run.py
run.py should implement one clear task end to end.
In practice, that means:
- parse inputs
- perform the workflow logic
- print useful output
- fail clearly if something goes wrong
Adding dependencies and secrets
When a workflow needs external packages:- add them to
requirements.txt - install them into the workflow’s local virtual environment
- refresh
requirements.lock.txt
- declare the key names in
workflow.jsonunderrequired_secrets - have the user add those keys in Profile Secrets, or ask an engineer to provide a Global Secret
- read the values in
run.pyfrom environment variables such asos.environ["STRIPE_SECRET_KEY"]
workflow.json, README.md, chat instructions, or source comments.
Reviewing and testing a workflow
Before asking your team to use a workflow:- check that the slug and intent still match what it does
- confirm the inputs are clear and correctly typed
- verify the timeout is reasonable
- document required setup in
README.md - test it with realistic inputs
- get engineer approval
When to choose a workflow instead of a skill
Choose a workflow when the main value is reliable execution. Examples:- syncing data between systems
- generating a report
- provisioning a standard resource
- running an operational remediation step