Skip to content
Docs

Quickstart: call an API on a schedule

In this tutorial you build a flow that fetches the current weather from a public API and stores the latest reading in a key-value entry. You test it against your draft, publish it, and arm a schedule so it runs every hour without you. By the end, the trigger badge on your canvas reads On and the toolbar reads Live: v1.

The API is Open-Meteo, which needs no API key, so you can follow along without signing up for anything.

What you build:

Schedule ──▶ Start ──▶ REST Request ──▶ Key-Value Set

Time: about 15 minutes.

  • A Publicus workspace where you can create flows and data stores.
  • Nothing else. Reading core concepts first helps, but is not required.

The flow overwrites one key-value entry with the newest API result on every run, so create the entry first.

  1. Open Data → Key-value in the sidebar and click New key-value entry.

    The Create key-value entry form with Key and Value fields, with Create, Cancel and a button to create another
    The Create key-value entry form with Key and Value fields, with Create, Cancel and a button to create another
  2. Set Key to latestWeather.

  3. Set Value to {}. The first run replaces it.

  4. Click Create.

  1. Open Automation → Flows and click New flow.

    The Create Flow dialog with a Title field, a Description field that agents and MCP clients read to decide when to call the flow, and Create and Cancel
    The Create Flow dialog with a Title field, a Description field that agents and MCP clients read to decide when to call the flow, and Create and Cancel
  2. Title it Hourly weather and create it.

You land on the canvas with a single Start node. Start is the flow’s entry point: it carries the run’s start payload and performs no work of its own. Keep it. Triggers connect into it, and your first working node connects after it.

A new flow's canvas with only the Start node in the middle, the Not published note beside the title, Edit with AI, Run by hand, Publish and Runs in the header, and Add node at the bottom
A new flow's canvas with only the Start node in the middle, the Not published note beside the title, Edit with AI, Run by hand, Publish and Runs in the header, and Add node at the bottom
  1. Click Add node on the canvas.

  2. Type Schedule into the search and pick Schedule. It sits on the picker’s “Triggers — start the flow” shelf. The node is added as soon as you pick it, named Schedule.

    The Add a node dialog with Schedule typed into its search, offering Schedule: Start the flow on a recurring schedule (cron) on the Triggers shelf
    The Add a node dialog with Schedule typed into its search, offering Schedule: Start the flow on a recurring schedule (cron) on the Triggers shelf
  3. Click the new node to open its configuration.

    The Schedule node's settings panel with the Cron expression field, Without overlapping ticked, a Timezone select, and Save changes at the bottom
    The Schedule node's settings panel with the Cron expression field, Without overlapping ticked, a Timezone select, and Save changes at the bottom
  4. In Cron expression, enter 0 * * * *. That is cron syntax for “every hour, on the hour”. It runs in the workspace’s time zone (UTC unless your workspace set one), not your browser’s. Leave Timezone empty to keep that.

  5. Leave Without overlapping on. It skips a tick when the previous run is still in progress.

  6. Save.

Now wire the trigger in: drag a connection from the port on the Schedule node’s right edge to the port on the Start node’s left edge.

The Schedule node wears a status badge that reads Off. That is correct for now. The schedule fires nothing until you arm it, which you do last.

  1. Click Add node and pick REST Request from the “API & integrations” shelf.

  2. Connect the Start node’s bottom port to the top port of the new node.

  3. Click the node to configure it. Its name is the heading of its settings: click it and rename the node Fetch weather.

    The REST Request node's settings panel: URL, Method and Credential, the folded More settings and Advanced sections below them, and Save changes at the bottom
    The REST Request node's settings panel: URL, Method and Credential, the folded More settings and Advanced sections below them, and Save changes at the bottom
  4. In URL, paste this URL (the coordinates are Amsterdam):

    https://api.open-meteo.com/v1/forecast?latitude=52.37&longitude=4.89&current_weather=true
  5. Leave Method empty. It defaults to GET.

  6. Save.

This API needs no authentication. When you call one that does, the Credential field takes a saved connection or secret instead of a hand-written header.

On a successful call, the response body becomes the node’s output, so the next node reads it as $prev. Open-Meteo responds with (trimmed):

{
"current_weather": {
"time": "2026-08-21T12:45",
"temperature": 20.0,
"windspeed": 11.5,
"winddirection": 6,
"is_day": 1,
"weathercode": 3
}
}
  1. Add a Key-Value Set node from the “Storage” shelf.

  2. Connect the bottom port of Fetch weather to its top port.

  3. Click the node to configure it, and rename it Keep latest the same way.

  4. In Key-value, select latestWeather.

  5. In Value, click Insert a value ({x}) to switch the field to expression mode, then click into the editor and enter:

    {!! json_encode($prev->current_weather) !!}
  6. Save.

$prev is the output of the node directly upstream, here the parsed API response. json_encode(...) turns its current_weather object back into JSON text, and the entry stores that as an object because it parses as JSON.

You do not have to wait for the schedule to see the flow work.

  1. Click Run by hand in the toolbar. It executes the graph you are editing, with its real side effects.
  2. The Run flow dialog opens with Start data closed. A schedule starts its run with no data, and so does this run, so leave it closed and click Run.
  3. The run appears in the Runs rail beside the canvas. Click it to open the run report, which lists every node with its output. Fetch weather shows the full API response.
  4. Open Data → Key-value: the latestWeather entry now holds the current weather.

Run by hand runs your draft unless you choose the live version. Triggered runs, including scheduled ones, execute the published version instead, which is why the next step exists.

  1. Click Publish in the toolbar.
  2. The confirmation explains what changes: triggered runs (schedules, webhooks, channels, agents) will execute this version. Confirm.
  3. A notification reports Published v1.

From now on, editing the canvas changes only your draft. The schedule keeps running v1 until you publish again. See draft, publish and versions for version history, diffs, and rollback.

  1. Click the Off badge on the Schedule node. This opens Trigger controls. Clicking the badge is different from clicking the node, which opens its configuration.
  2. Switch Active on and save. Arming takes effect immediately. It is not part of the graph, so it does not wait for a publish and no publish captures it.
  3. Click the badge again: the modal now shows Next run with the exact time of the next tick, in the schedule’s time zone. That row only appears while the schedule is armed.
Trigger controls for an armed schedule: the Active toggle on, the Next run time, Last fired, and Save
Trigger controls for an armed schedule: the Active toggle on, the Next run time, Last fired, and Save

The badge now reads On: the trigger fires. The version note on the toolbar still reads Live: v1, so the runs it starts execute published version 1. Until the first tick the badge adds · never, because it has not started a run yet. After the first run, that turns into a countdown to the next one.

An unattended integration: a schedule that fires every hour, a REST call to a public API, and a key-value entry that always holds the latest result. Along the way you used the full lifecycle every triggered flow goes through: build on the draft, test with Run by hand, publish, arm the trigger.

  • Schedule flows covers cron syntax and the Schedules screen under Operations.
  • Triggers and arming explains badge states and the published-versus-draft rule for every trigger type.
  • REST Request documents the node’s remaining fields: credentials, timeouts, and error handling.
  • Runs shows what the run report tells you when an API call fails.
  • Paginate API results when one request per run stops being enough.