ifURI examples
← all examples

17 — flows: usage scenarios in txt, bash and YAML

A flow is an ordered list of URI steps (query reads, command mutates), gated by policy and chaining prior results. The same scenarios appear in three forms so you can pick the one that fits:

urirun-flow (Pydantic): urirun-flow to-yaml web_recon.flow:flow emits the YAML above, urirun-flow run … --execute runs it.

make setup                 # generate the registries the flows reference
make local                 # scenario 1 — offline (timestamp + audit log)
make web                   # scenario 2 — httpcheck + real Chrome DOM + log
make declarative           # scenario 3 — drive httpbin from a TOML spec
make ksef                  # scenario 5 — KSeF challenge+send (dry-run, no secret)
make test                  # offline CI test

YAML flow shape

task: { title: "..." }
registry: tools.bindings.json          # a bindings or registry path (relative)
allow: [ "time://*", "log://*" ]        # policy globs
secretAllow: [ "getv://TOKEN" ]         # secret:// references this flow may resolve
steps:
  - id: stamp
    uri: time://host/clock/query/now
    payload: {}
  - id: audit
    uri: log://host/run/command/write
    payload: { event: "demo", url_from: "stamp.result.url" }   # _from chains a prior result
    depends_on: [ stamp ]

run_flow.py <flow> [--execute] [--allow GLOB] [--secret-allow GLOB]. Default is dry-run — nothing executes, no secret resolves, the plan is printed. query steps run freely with --execute; command steps need an --allow glob, so the same flow is safe to dry-run and explicit to execute.

Scenarios

#ScenarioURIsNeeds
1local audittime://log://nothing (offline)
2web reconhttpcheck://browser://chromelog://network + Chrome
3declarative HTTPhttpbin://... (from a TOML spec)network
4secret callsdemo://... with Bearer {getv:DEMO_TOKEN}see ../16-secrets
5KSeFksef://test/auth/challenge.../senddry-run safe
6LLM agentplanner picks the URIssee ../14-llm-uri-agent

Every step is a URI + payload + policy decision — auditable, replayable, and the same surface an LLM, MCP client or A2A peer would drive.

Files

.gitignoreMakefileREADME.mdflow-declarative.shflow-ksef.shflow-local.shflow-web-recon.shksef-send.flow.yamllocal.flow.yamlrun_flow.pyscenarios.txttest_flows.pytools.bindings.jsonweb-recon.flow.yamlweb_recon.flow.py.benchmarks/

View on GitHub →