API GET functionality for status of jobs and listing messages

Migrated from: Feature request: API GET functionality for status of jobs and listing messages · Issue #99 · OpenFn/docs · GitHub

From: acawood777

We’d love to be able to access OpenFn via an API.

We’re building a dashboard webpage that keeps tabs on all of the bits of our integrated systems. We’d like to be able to list the last 10 failed OpenFn jobs here, or show a count of failed jobs in the last 24hrs/week/month.

We’d typically like to be able to access the data currently shown on the Inbox page:

So:

  • Get a list of Inbox messages, sorted by time received. Return timestamp, id, and last action success/failure
  • Filter by content
  • Filter by related runs (successful, failed, no related runs)

But also, importantly:

  • Filter by timestamp

Perhaps a default limit of (e.g.) 10 records returned, but with this num_records parameter specifiable up to some maximum that you could decide on (e.g. 100)

2 Likes

I like this concept and could see a job status API supporting interesting enhancements to the OpenFn CLI. Rough examples:

openfn workorder list --status failed
openfn wo list --status failed --from <date> --to <date>
openfn wo describe --workorderId <id> [-f yaml | json]
openfn wo rerun --workorderId <id> [--fromJob <jobReference>]
1 Like