My first flow
You will write a flow that fetches a list from an internal API and writes the rows to a CSV file, validate it with the same validator as publication, and start it.
-
Write the flow in
rates.flow.yaml:schema: automatrpa/flow/v1id: ratesparams:currency: { type: string, default: BRL }steps:- id: fetchuses: std.http.request@1.0.0with:method: GETurl: https://rates.example.internal/api/v1/ratesquery: { currency: "${{ params.currency }}" }auth: tokencredentials:auth: rates_api_tokentimeout: 30sretry: { max: 3, backoff: exponential, initial: 1s, on: [transient, timeout] }- id: writeuses: std.table.write@1.0.0with:rows: ${{ steps.fetch.outputs.items }}path: rates.csvoutputs:file: ${{ steps.write.outputs.file }}The secret
rates_api_tokenis named only: its value stays in the vault and reaches the step on standard input, never in a log or an argument. -
Validate locally.
Janela do terminal automatrpa validate rates.flow.yamlautomatrpa validate --format json rates.flow.yaml # file, line, column and messageExit code 0 means valid; 1 means invalid.
-
Publish and start it.
Janela do terminal automatrpa loginautomatrpa flow publish rates.flow.yaml --folder <folder id> --message "first version"automatrpa run trigger --flow rates --param currency=BRLautomatrpa run show <run id> -
Follow it in the UI. On Runs, open the run: each step shows its attempts, live logs, outputs and the
rates.csvartifact.