Skip to main content
GET
/
api
/
workflows
/
v1
/
{workflowId}
/
runs
List workflow runs
curl --request GET \
  --url https://app.trelica.com/api/workflows/v1/{workflowId}/runs \
  --header 'Authorization: Bearer <token>'
{
  "next": "https://app.trelica.com/api/workflows/v1/b7288c2c64f779e28024ea0e/runs?after=eyJpZCI6IjY2MmE4YzExZjA3YmEwYWY5YTI1Yzg2MCJ9&limit=100",
  "results": [
    {
      "id": "649454cc391d7e83ae7a0aa5",
      "name": "Shirley Lane",
      "status": "Completed",
      "createdBy": {
        "userId": "a9b8c7d6-e5f4-43a2-b1c0-9a8b7c6d5e4f",
        "name": "Samira Johnson",
        "email": "samira.johnson@example.com"
      },
      "createdDtm": "2023-06-22T14:03:56.248Z",
      "deleted": false,
      "lastModifiedDtm": "2023-06-22T14:04:16.157Z",
      "context": {
        "person": {
          "id": "67aa6cdf421044b49ad1d6dfded7bf21",
          "name": "Shirley Lane",
          "firstName": "Shirley",
          "lastName": "Lane",
          "email": "shirley.lane@example.com",
          "employeeId": "E001529",
          "location": "Cambridge, UK",
          "jobTitle": "Content Lead",
          "team": "Web site",
          "leavingDate": "2023-05-25T00:00:00Z",
          "customFields": {
            "personalemail": null
          }
        }
      },
      "trigger": {
        "id": "54d9783a47e694183a270549",
        "type": "PersonLeaves",
        "status": "Completed",
        "completed": {
          "dtm": "2023-06-22T14:04:15.021Z",
          "nextStepIds": [
            "54d9783a47e694183a27054a"
          ],
          "newContext": {
            "person": {
              "id": "67aa6cdf421044b49ad1d6dfded7bf21",
              "name": "Shirley Lane",
              "firstName": "Shirley",
              "lastName": "Lane",
              "email": "shirley.lane@example.com",
              "employeeId": "E001529",
              "location": "Cambridge, UK",
              "jobTitle": "Content Lead",
              "team": "Web site",
              "leavingDate": "2023-05-25T00:00:00Z",
              "customFields": {
                "personalemail": null
              }
            }
          }
        }
      },
      "steps": [
        {
          "id": "54d9783a47e694183a27054a",
          "type": "OffboardPersonApps",
          "name": "Offboard person from apps",
          "status": "Completed",
          "completed": {
            "dtm": "2023-06-22T14:04:16.149Z",
            "nextStepIds": []
          }
        }
      ]
    },
    {
      "id": "662a8c11f07ba0af9a25c860",
      "name": "Stephanie Mason",
      "status": "Waiting",
      "createdBy": {
        "userId": "7cbf8b34-a321-43f0-8c8f-275b41e30b14",
        "name": "System",
        "email": "admin@example.com"
      },
      "createdDtm": "2024-04-25T17:00:01.207Z",
      "deleted": false,
      "lastModifiedDtm": "2024-04-25T17:00:01.375Z",
      "context": {
        "person": {
          "id": "0ad0090d2f27407ba1312883e805b123",
          "name": "Stephanie Mason",
          "firstName": "Stephanie",
          "lastName": "Mason",
          "email": "stephanie.mason@example.com",
          "employeeId": "E001557",
          "location": "Palo Alto, CA",
          "jobTitle": "Accounts Receivable Executive",
          "team": "Accounts Receivable",
          "startDate": "2022-06-04T00:00:00Z",
          "leavingDate": "2024-04-07T00:00:00Z",
          "customFields": {
            "personalemail": null
          }
        }
      },
      "trigger": {
        "id": "54d9783a47e694183a270549",
        "type": "PersonLeaves",
        "status": "Waiting",
        "waiting": {
          "dtm": "2024-04-25T17:00:01.326Z"
        }
      },
      "steps": []
    }
  ]
}

Authorizations

Authorization
string
header
required

OAuth 2.0. Obtain an access token via the Client Credentials or Authorization Code flow, then send it as Authorization: Bearer <token>.

Path Parameters

workflowId
string
required

Query Parameters

filter
string

A SCIM-style filter expression restricting the items returned. See the Filtering section of the introduction for the operators and syntax; the filterable fields are listed per resource.

Filterable fields

  • string: context.app.id, context.app.name, context.appUser.appId, context.appUser.appInstanceName, context.appUser.appName, context.appUser.id, context.appUser.primaryExternalEmail, context.appUser.primaryExternalId, context.appUser.userEmail, context.appUser.userId, context.appUser.userName, context.person.email, context.person.id, context.person.lineManager.email, context.person.lineManager.id, context.person.lineManager.name, context.person.name, context.task.appliesToItemId, context.task.appliesToItemName, context.task.appliesToType, context.task.assignedTo.email, context.task.assignedTo.id, context.task.assignedTo.name, context.task.description, context.task.id, context.task.owner.email, context.task.owner.id, context.task.owner.name, context.task.status, context.task.taskTypeId, context.task.title, createdBy.email, createdBy.name, createdBy.userId, id, lastModifiedBy.email, lastModifiedBy.name, lastModifiedBy.userId, status, steps[failed.message], steps[id], steps[status]
  • date: context.person.leavingDate, context.person.startDate, context.task.dueDate, createdDtm, lastModifiedDtm, steps[completed.dtm], steps[failed.dtm], steps[waiting.dtm], steps[waiting.untilDtm], waitingUntilDtm
  • boolean: deleted

Filter examples

  • status eq "Waiting" — Runs that are currently waiting for input
  • steps[status eq "Waiting"] — Runs with a step that is waiting
  • context.person.email eq "new.starter@example.com" — Runs whose context person has the given email
  • createdDtm ge "2022-01-01" — Runs created on or after 1 Jan 2022
  • not (waitingUntilDtm pr) — Runs that are not waiting until a future time
q
string

Free-text search across the resource's displayable fields.

since
string<date-time>

Only return items modified at or after this ISO-8601 timestamp.

until
string<date-time>

Only return items modified at or before this ISO-8601 timestamp.

after
string

Opaque pagination cursor supplied by SaaS Manager via the link response header and the next field.

limit
integer
default:100

Maximum number of items to return per page (default 100, maximum 1000).

Required range: 1 <= x <= 1000
variables
string

A comma-separated list of workflow variable IDs whose values should be included in each run's context. Values are omitted unless requested here. Reading a secret (password) variable additionally requires the Workflows.Runs.ReadSecrets scope.

Response

OK

next
string

The URL of the next page of results. Absent when there are no more results.

results
object[]

The page of results.