Skip to content

Scheduled Flows

Not all integrations are event-driven. fyrn supports scheduled execution, polling, and manual triggers for batch jobs, periodic syncs, and on-demand operations.

Run a flow on a schedule using standard 5-field cron syntax:

flow: daily-report-sync
version: 1
source:
connector: report-api
trigger: schedule
schedule: "0 6 * * *" # Every day at 6:00 AM
timezone: "Europe/Helsinki" # IANA timezone
target:
connector: data-warehouse
endpoint: /api/reports
method: POST
mapping:
report_date: '"" | now | date("YYYY-MM-DD")'
on_error:
retry: 3x exponential(60s)
then: dead-letter
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-7, Sun=0 or 7)
│ │ │ │ │
* * * * *

Examples:

CronDescription
0 6 * * *Every day at 6:00 AM
0 9 * * 1-5Weekdays at 9:00 AM
*/15 * * * *Every 15 minutes
0 0 1 * *First of every month at midnight
0 6 1 * *First of every month at 6:00 AM

Poll an external API for new records on a periodic basis:

flow: poll-legacy-orders
version: 1
source:
connector: legacy-system
trigger: poll
poll:
url: https://api.example.com/orders
method: GET
headers:
Authorization: "Bearer {{instance.api_key}}"
params:
status: new
limit: "100"
records_path: data.orders
pagination:
strategy: cursor
cursor_path: meta.next_cursor
cursor_param: after
max_pages: 100
target:
connector: erp-system
endpoint: /api/orders
method: POST
mapping:
order_id: source.id
total: source.amount | decimal(2)
on_error:
retry: 3x exponential(30s)
then: dead-letter

fyrn supports four pagination strategies for poll triggers:

cursor — Pass a cursor value from the response to the next request:

pagination:
strategy: cursor
cursor_path: meta.next_cursor
cursor_param: after

offset — Increment a numeric offset by the page size:

pagination:
strategy: offset
offset_param: offset
page_size: 100
total_path: meta.total_count

link_header — Follow the Link header’s rel="next" URL (common in GitHub-style APIs):

pagination:
strategy: link_header

next_token — Use a token from the response body (common in AWS-style APIs):

pagination:
strategy: next_token
token_path: NextToken
token_param: NextToken

All strategies support max_pages to cap the number of pages fetched per poll cycle.

See DSL Reference — Poll Config for all pagination strategies.


Run a flow on demand from the CLI or UI:

source:
connector: import-service
trigger: manual
Terminal window
# Trigger via CLI (send payload through the flow)
fyrn flow show <flow-id> # get webhook URL
curl -X POST <webhook-url> -d '{"data": "..."}'

Terminal window
# List all schedules
fyrn schedules list
# Manually trigger a scheduled flow
fyrn schedules trigger my-flow
fyrn schedules trigger <flow-id>
{
"name": "list_schedules",
"arguments": {}
}
{
"name": "update_schedule",
"arguments": {
"schedule_id": "...",
"cron_expression": "0 9 * * 1-5",
"timezone": "America/New_York",
"enabled": true
}
}

Manage schedules programmatically via the REST API:

Terminal window
# List all schedules
GET /api/v1/schedules
# Update a schedule (cron, timezone, enabled)
PUT /api/v1/schedules/:id
Content-Type: application/json
{"cron_expression": "0 9 * * 1-5", "timezone": "America/New_York", "enabled": true}
# Trigger a scheduled flow immediately (outside its normal cron cycle)
POST /api/v1/schedules/:id/trigger

See the API Reference for authentication headers and full response schemas.


Each schedule tracks:

FieldDescription
cronExpressionThe cron pattern
timezoneIANA timezone
enabledWhether the schedule is active
lastRunAtWhen it last executed
nextRunAtWhen it will execute next
lastRunStatussuccess, failed, or running