Flows YAML — expression language (parser, evaluator, builtins) #1062
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#1062
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As a flow author, I want a single expression language usable in flow-level
if:, per-stepif:, and${{ }}interpolations, so that I can compose conditions likehas_label('area:agents') && !author_is('dev')without learning multiple sub-syntaxes.Acceptance criteria
Parser
apps/server/src/domain/flows-yaml/expr/parser.ts.&&,||,!,==,!=,in,matches,<,<=,>,>=.'…'), number, bool, null.event.pr.labels,steps.id.outputs.key.has_label('x').Evaluator
evaluate(ast, ctx)returnsboolean | string | number | null | array.ExpressionErrorwith span.&&/||.Built-in functions
has_label(name),has_any_label(...),has_all_labels(...)— read from current event PR/issue labels.author_is(...).repo_matches(glob)— port glob impl fromflow-dispatch.ts.comment_matches(regex).event_action().Built-in variables
event.kind,event.action,event.repo,event.pr.*,event.issue.*,event.comment.*.steps.<id>.outputs.<key>.env.<KEY>from flowenv:block.Interpolation
${{ expr }}insidewith:arg values is resolved before op runs.Tests
Out of scope
References
docs/specs/flows-yaml.md§7.matchesFilters()atapps/server/src/domain/flows/flow-dispatch.ts:356–407.