Log new FRED economic series observations to Airtable
A FRED + Airtable agent flow
An economist or a finance team tracks a handful of FRED series, CPI, unemployment, a Treasury yield, and wants each new release captured in a table they can chart and join against, not re-pulled from the FRED site every month. The agent retrieves observations for each series with fred_get_series, finds the dates that weren't there last run, and writes a record per new observation to Airtable with create_record. FRED answers the agent's call, so the read runs on a schedule and only observations newer than what's already logged become rows.
The flow
fred_get_seriesRetrieves a series' observations with date-range and transformation options.
create_recordCreate a new record in a table with the given field values.
Step by step
- Pick the series and the table
List the FRED series IDs the agent reads, like CPIAUCSL or UNRATE, and point it at an Airtable table with fields for series, date, and value. Decide the cadence, daily is fine since releases are infrequent.
- Read the observations
For each series the agent calls fred_get_series, reading the observation dates and values over a recent range, with any transformation you set such as percent change.
- Find new observations
Compare the observation dates to what's already in the table for that series. Write only dates not yet logged, so a series that hasn't updated produces no rows and a new release produces exactly one.
- Write the rows
For each new observation the agent calls create_record with the series ID, the observation date, and the value, leaving a clean dated series in Airtable to chart or join.
Tell your agent
Each morning, read the last 90 days of observations for FRED series CPIAUCSL and UNRATE. For any observation date not already in the Airtable Indicators table for that series, create a record with the series ID, the date, and the value. Don't write a date you've already logged.
Setup
This flow needs both servers connected to your agent. Follow each install guide:
Worth knowing
- FRED revises past observations, so a value for a prior month can change after first release. Decide whether the agent updates an existing row on a revision with update_records, or only ever appends, and document which.
- create_record writes one record per call, so on a backfill the agent loops the new observations; cap the initial range so it doesn't write decades of monthly data in one run.
- fred_get_series returns observations within the range you ask for, not only new ones, so the agent must diff against the table by date to avoid re-creating rows it already wrote.
Questions
- How does it know which observations are new?
- By reading the dates already in the Airtable table for that series and writing only observation dates that aren't there. A series with no new release that day produces no rows.
- Can it apply a transformation like year-over-year change?
- Yes. fred_get_series supports transformations, so the agent can ask for percent change from a year ago and log the transformed value instead of, or alongside, the raw level.