showcase · tier 2 · business
Invoice chaser
jq filters the overdue rows out of the CSV, reminders get drafted, and a human gate sits before anything is saved.
- 6tasksthe plan falls out of the bindings
- 6wavesparallel by construction
- 2verbs exercisedinvoke · infer
- T2the tierbusiness
The whole file
6 tasks · 6 wavesThe plan falls out of the bindings, nothing is scheduled by hand.
invoice-chaser.nika.yamlsource
nika: v1workflow: id: invoice-chaser description: "Ledger CSV → overdue filter → drafted reminders → human gate → drafts file"model: ollama/qwen3.5:4b # local · zero key · swap for groq/llama-3.3-70b (drafting is a fast-model job)const: ledger_csv: "examples/fixtures/invoices.csv"permits: tools: ["nika:convert", "nika:jq", "nika:prompt", "nika:read", "nika:write"] fs: # Two files, both spelled out — `const.ledger_csv` in, the drafts file # out. A const is baked in and a run cannot move it, so the boundary is # exact: no glob, and nothing else on disk is reachable either way. read: ["examples/fixtures/invoices.csv"] write: ["out/reminders-to-send.md"]tasks: ledger: invoke: tool: "nika:read" args: { path: "${{ const.ledger_csv }}" } rows: with: csv: ${{ tasks.ledger.output }} invoke: tool: "nika:convert" args: input: "${{ with.csv }}" from: csv to: json has_header: true overdue: with: rows: ${{ tasks.rows.output }} invoke: tool: "nika:jq" args: input: "${{ with.rows }}" expression: 'map(select(.status == "overdue"))' drafts: with: overdue: ${{ tasks.overdue.output }} when: ${{ size(with.overdue) > 0 }} infer: max_tokens: 900 # a ceiling makes the cost report a number, not UNBOUNDED prompt: | Draft one short, polite payment reminder per overdue invoice · ${{ with.overdue }} Markdown · one section per client · firm but warm. approve: with: drafts: ${{ tasks.drafts.output }} when: ${{ with.drafts != null }} # nothing drafted · nothing to approve invoke: tool: "nika:prompt" args: message: "Save the reminder drafts for sending?" default: false save: with: drafts: ${{ tasks.drafts.output }} approved: ${{ tasks.approve.output }} when: ${{ with.drafts != null && with.approved == true }} # zero overdue → drafts skipped (null) · don't write nothing invoke: tool: "nika:write" args: path: out/reminders-to-send.md create_dirs: true content: "${{ with.drafts }}"outputs: overdue: value: ${{ tasks.overdue.output }} description: "The overdue rows the reminders were drafted for"nika inspect · engine 0.106.1 · vendored graph, never re-derived
6 declared edges · 6 waves · the plan falls out of the bindings