# Workflows
A workflow is a pipeline of *actions*, *agents* or *commands* that run in sequence. It is
defined in YAML.
Example `features/workflows/commit_msg.yml` workflow that uses
the `features/actions/git_diff.js` action and the `features/agents/commit_msg.yml` agent:
```yaml
title: "Generate a git commit message from a git diff"
steps:
- action: git_diff
- agent: commit_msg
```
Note: the result of an action or agent is passed to the next one, except for the special case of *adaptaters*.
## Adaptaters
An adaptater is a JavaScript script that manipulates data between
two workflow steps, often to convert data and adapt required formats.
Adaptaters are declared in an `adaptaters` folder of a plugin. Example: an
adaptater to parse command line input. The q workflow from the
inference plugin.
Workflow:
```yaml
steps:
- adaptater: prequery
- agent: infer
```
This adaptater parses the command line arguments and dispatch them for the `infer` agent
that will run next in the workflow:
```js
// adaptaters/prequery.js
async function action(params, options) {
const res = { prompt: params.join(" ") };
return res;
}
export { action };
```
Usage:
```bash
lm q list the planets of the solar systems
# equivalent to the single agent:
lm infer "list the planets of the solar systems"
```
Next: Commands