Not every pipeline is a big file drop. A lot of finance and operations data arrives through a provider's API: card transactions, tolls, telematics, payroll exports. The pipeline is short (call the API, land the data, apply a rule or two) and it is exactly the kind of job that ends up as a script on someone's laptop. Drawing it in InsightDataFlow puts it on the same scheduler, with the same review, as every other pipeline.
Northbeam's fuel cards
Northbeam Logistics (a fictional company) pays for diesel with fuel cards from a provider whose API returns the previous day's transactions. Omar, in the finance data team, needs them in finance.fuel_tx by mid-morning, with any transaction for more litres than the vehicle's tank holds flagged for review. Until now a script did it when Omar remembered.
Four nodes

- Fetch transactions (
API): a flexible REST caller with a base URL, an endpoint, a method, headers, query parameters and a body. Omar sets the base URL and/v1/transactions, and sets the method to GET (the node defaults to POST). - Load
finance.fuel_tx(LOAD_DATABASE): load the day's transactions into the finance schema through the warehouse data location. - Flag anomalies: one query that selects the transactions where the litres exceed the tank size, run as a
LOAD_DATABASEstep whose input source is that query, writing tofinance.fuel_tx_flagsthrough the same warehouse data location. Finance can read the rule, and change it, without touching Python.
In the workflow list the pipeline is source API, category finance, priority P2, schedule
30 6 * * *.
API node takes its headers as plain parameters and has no data-location field, so an API key typed into a header is an API key in properties.yaml and in every deployed copy of it. Agree with your platform team how the provider's key is supplied at run time, and treat the deployed folder as sensitive either way.The hand-off between the call and the load
One detail is easy to miss on a canvas. An edge says "run the load after the call"; it does not pipe the API's response into the load.
LOAD_DATABASE reads a CSV file, a Parquet file or a table, and the API node returns the response as its result.
So the pipeline needs an agreed place in between: the provider's export written to a file in the landing bucket, or a staging table, which
the load then reads. Design and test that hand-off first. It is the step most likely to work in a test and fail on the first real night.
The API node, filled in
| Parameter | Omar's value (made up) | Why |
|---|---|---|
| Base URL + endpoint | https://api.fuelcards.example.test + /v1/transactions | Or one complete URL in the URL field instead. |
| Method | GET | The default is POST; a read-only pull should say GET. |
| Query | A JSON object with the day to fetch | Kept apart from the endpoint so a reviewer sees what changes per run. |
| Timeout | Raised from the default 30 seconds | Provider APIs can be slow early in the morning; a timeout is a failed task. |
Reruns and duplicates
A finance table must not double-count. LOAD_DATABASE appends by default, so a rerun after a partial failure appends the same
transactions twice. The load node also offers overwrite, replace and truncate modes. Two workable patterns:
- Truncate a staging table, then insert. Load the day into a staging table in truncate mode, and delete that day from
finance.fuel_txand insert it again (aSHELLstep that runs both statements with your database client). Reruns are safe; the rule stays readable. - Append with a guard. Keep append, and add a check after the load that fails when a transaction id appears twice. Simpler, but a rerun then needs a manual clean-up.
Whichever you pick, remember the generated DAG retries a failed task once, five minutes later, and that retry is itself a rerun.
Why not keep the script?
- It runs when nobody remembers. The schedule is Airflow's, not Omar's calendar.
- It fails visibly. A failed API call or load is a failed task in Airflow with a name ("Fetch transactions"), not a missing email.
- It is reviewable. The anomaly rule is a line in
properties.yaml; a change to it is a diff someone approves. - It is like everything else. The DAG has the same shape as the logistics team's nightly load, so the platform team operates both the same way.
The rule changes; the pipeline does not
Finance decides that a transaction outside the driver's planned route is also worth flagging. Omar adds a second rule step after the first, regenerates, and the reviewer sees one new task and one new query. Nothing else in the pipeline moves. An illustration on made-up data.
Questions the finance team asks
Can we change the anomaly rule ourselves?
The rule is a query in a node's parameters, editable in the designer by anyone with the role to save and deploy workflows (admin, in the API). Finance can hold that role, or send the change to the data team for review: your governance decides.
What happens when the provider's API is down?
The call fails, Airflow retries it once, and then the task fails under its own name. Nothing downstream runs, so the table keeps yesterday's data rather than a half-loaded day.
Does the provider page its results?
Ask before you build. The API node makes one request per run; a paged API needs the pages handled somewhere, ideally by an
export endpoint that returns the whole day.
Can it run more than once a day?
Yes: the schedule is a cron expression, so an intraday pull is a schedule change. Generated DAGs allow one active run at a time, so a slow run delays the next one instead of overlapping it, which for a finance table is the behaviour you want.
Checklist for API pipelines
- Find out how the provider pages results and what "yesterday" means in its time zone.
- Decide what a rerun does: append duplicates, or replace the day. Make the load match.
- Add a check after the load (a
RECORD_COUNT_VALIDATIONnode) so an empty response is a failure, not a quiet zero. - Keep credentials in the data location, not in parameters; review
properties.yamlbefore every deploy, and restrict who can read the deployedconfig.yaml, which carries the location's credentials.


