Workflow YAML
Workflow v1 is validated by the CLI. It supports Gmail, Lark, or both as sources, asks Jev to classify new conversation state, and permits exactly one save_reply_draft action. Live provider integrations still need account verification.
Example
version: 1
id: reply-review
sources:
- provider: gmail
account: personal
- provider: lark
account: work
schedule:
every_minutes: 5
filter:
bot: jev
question: "Does this new message need a personal reply from me?"
match_at_or_above: 0.7
actions:
- type: save_reply_draft
composer: codex
max_words: 120Fields and behavior
versionmust be1;idnames the workflow.- Each
sourcesentry selectsgmailorlarkand a local account alias created withhafi connect. schedule.every_minutesaccepts1,2,5,10,15,30, or60.filter.botisjev; the question and score threshold control which conversations reach the action.actionsmust contain exactly onesave_reply_draftaction.max_wordsbounds the suggested reply.- Unknown fields and action types are rejected. The YAML cannot run arbitrary commands, scripts, or remote includes.
Jev evaluates new conversation state against filter.question. A score at or above match_at_or_above selects the action. The saved draft is a local result for review; the user sends any reply in the original app. The first workflow does not send messages or notifications.
Validate and inspect
bun run dev workflow validate hafi.yaml
bun run dev workflow validate hafi.yaml --json
bun run dev schedule print --workflow hafi.yaml --platform cronValidation checks workflow shape before a run. schedule print prints an entry for system cron; it does not install or activate the schedule. See Getting started for connection and run commands.
Example file
The repository root includes hafi.workflow.example.yaml. Copy it into your project and remove the source you do not use. Account aliases must match connections on the machine where Hafi runs.