# Workflows

> A workflow is the script your agent follows on every call: the steps, the order they run in, and the values they pass along.

Source: https://voxio.in/docs/workflows · voxioagent 2.0.0 · Index: https://voxio.in/docs/llms.txt

Every flow has one workflow. You build it on the flow's **Workflow** tab by dragging steps onto a canvas and joining them, or you write it as JSON. Both are the same thing: the editor reads and writes the JSON, and the engine runs the JSON.

## The pieces

| Piece | What it is |
| --- | --- |
| **Step** | One thing the agent does: speak, listen, think with an AI, or choose a path. See [Steps](https://voxio.in/docs/steps.md). |
| **Line** | Where to go after a step. In JSON it's the step's `next`, or a Branch's `mappings`. |
| **Start step** | Where every call begins (`start_node`). Usually a greeting. |
| **Values** | Named values the steps share during a call, such as `user_input` (what the caller said) and `speak` (what to say). See [Values and state](https://voxio.in/docs/workflows-values.md). |

## The smallest useful workflow

Greet, then loop: listen, think, reply, listen again. If the AI decides the call is over, it sets `hangup` and the call ends after the reply is spoken:

workflow.json:

```json
{
  "start_node": "greeting",
  "variables": {
    "user_input": { "type": "str" },
    "conversation_history": { "type": "list", "default": [] },
    "speak": { "type": "str" },
    "hangup": { "type": "bool", "default": false }
  },
  "nodes": {
    "greeting": {
      "type": "out",
      "parameters": { "out_dict": { "speak": "Hi! How can I help you today?" }, "interruption_type": "no" },
      "next": "ask_for_input"
    },
    "ask_for_input": {
      "type": "input",
      "parameters": { "input_variables": { "user_input": "str" } },
      "next": "think"
    },
    "think": {
      "type": "llm",
      "parameters": {
        "system_prompt": "You are the receptionist at Sunrise Dental. Keep replies to one or two sentences.",
        "service": "groq",
        "model": "openai/gpt-oss-120b",
        "input_variables": { "user_input": { "type": "str", "description": "What the caller said." } },
        "llm_return_type": {
          "speak": { "type": "str", "description": "What to say to the caller." },
          "hangup": { "type": "bool", "description": "True once the conversation is over." }
        },
        "history_key": "conversation_history"
      },
      "next": "reply"
    },
    "reply": {
      "type": "out",
      "parameters": { "variables": ["speak", "hangup"] },
      "next": "ask_for_input"
    }
  }
}
```

## In this section

| Page | Read it to |
| --- | --- |
| [How a call runs](https://voxio.in/docs/workflows-running.md) | understand the order steps run in, side by side steps, and waiting for the caller. |
| [Values and state](https://voxio.in/docs/workflows-values.md) | pass information between steps and to your webhook. |
| [Patterns](https://voxio.in/docs/workflows-patterns.md) | copy proven shapes: instant acknowledgement, branching, ending the call. |
| [Import, export and code](https://voxio.in/docs/workflows-share.md) | move workflows between flows and accounts, or manage them from your server. |

## Next steps

- [How a call runs](https://voxio.in/docs/workflows-running.md): the rules the engine follows.
- [Steps](https://voxio.in/docs/steps.md): every kind of step.
