Skip to content
Back to skills

Flow Building

ASecurity

Background knowledge for building, editing, and debugging Aflow flow definitions and agent configurations. Covers flow schema, step definitions, state variables, agent turn lifecycle, validation pipeline, and input contracts.

  • 2 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added October 23, 2026
ai-agentsdebuggingapidatabase

Works with

  • terminal
  • api
  • mcp

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned October 23, 2026

npx -y skills add aflowai/aflow --skill flow-building --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Flow Building?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Flow Building
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aflowai-flow-building/badge)](https://www.skillsdirectory.com/skills/aflowai-flow-building)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: flow-building
description: Background knowledge for building, editing, and debugging Aflow flow definitions and agent configurations. Covers flow schema, step definitions, state variables, agent turn lifecycle, validation pipeline, and input contracts.
user-invocable: false
---

# Flow & Agent Building Guide

This skill provides the domain knowledge needed to correctly build flows and configure agents on the Aflow platform.

## Quick orientation

A **flow** is a graph of **steps** connected by **transitions**. Each step executes one **operation** (from the catalog). **State variables** carry data between steps. **Agent steps** (`ai.agent.turn`) are decision points — the agent picks the next step(s) from the graph.

## Canonical examples

**Always consult `packages/database/src/seeds/capabilityFlows.ts`** before building flows. It contains 6 production capability flows (orchestrator, flow-builder, api-configurator, media-creator, mcp-runner, ml-prediction-agent) that are maintained alongside the platform code and always reflect the latest patterns.

## Common mistakes (fix these first)

| Mistake                                            | Fix                                                                                 |
| -------------------------------------------------- | ----------------------------------------------------------------------------------- |
| Missing `startStepId` or it doesn't match any step | Must reference an existing `stepId` in `steps[]`                                    |
| Transition target references non-existent step     | All `onSuccess`/`onFailure` `stepId` values must exist in `steps[]`                 |
| Unreachable steps                                  | Every step must be reachable from `startStepId` via BFS                             |
| Passing `{ prompt: "hello" }` as flow input        | Use standard envelope: `{ input: "hello" }` or `{ input: "hello", config: {...} }`  |
| Duplicate `stepId` or `variableId`                 | Must be unique within the flow                                                      |
| Using old operation names                          | Use canonical `stepType.group.verb` IDs (e.g., `ai.agent.turn` not `ai.agent_turn`) |
| Agent tool steps with hardcoded config             | Tool steps called by agents get inputs at runtime — don't validate their config     |
| Non-terminal flow with no transitions              | At least one step needs `onSuccess` pointing somewhere, or flow ends immediately    |
| `outputMapping` targets undeclared variable        | Target must exist in `stateVariables[]`                                             |
| `${state.foo}` references non-existent variable    | Variable must be declared in `stateVariables[]`                                     |

## Key schemas — see references/

For detailed schema fields, validation rules, and agent turn configuration, see:

- [schema.md](references/schema.md) — Flow, step, and state variable schemas with all fields
- [agent-pattern.md](references/agent-pattern.md) — Agent turn lifecycle, roles, policies, decision actions
- [validation.md](references/validation.md) — 5-layer validation pipeline with all rule IDs

Files in this skill

  • SKILL.md3.2 KB
  • references/agent-pattern.md7.2 KB
  • references/schema.md8.8 KB
  • references/validation.md4.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.