Knock · Arazzo Workflow

Knock Schedule a Recurring Workflow

Version 1.0.0

Identify a recipient, create a recurring schedule, then verify it was registered.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub NotificationsMessagingInfrastructureWorkflowsCross-ChannelEmailSMSPushIn-AppChatSlackWebhooksMCPAI AgentsDeveloper PlatformArazzoWorkflows

Provider

knock-app

Workflows

schedule-recurring-workflow
Identify a user, create a schedule, and confirm it was registered.
Upserts the recipient, creates a schedule for the named workflow with the supplied repeat rules, and lists schedules to verify registration.
3 steps inputs: apiKey, data, email, repeats, scheduledAt, tenant, userId, workflowKey outputs: scheduleId, userId
1
identifyUser
identifyUser
Upsert the recipient so the schedule has a valid user to target.
2
createSchedule
createSchedules
Create a schedule for the workflow and recipient using the supplied repeat rules and optional start time.
3
verifySchedule
listSchedules
List schedules for the workflow and recipient to confirm the new schedule is registered.

Source API Descriptions

Arazzo Workflow Specification

knock-app-schedule-recurring-workflow-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Knock Schedule a Recurring Workflow
  summary: Identify a recipient, create a recurring schedule, then verify it was registered.
  description: >-
    Schedules run a workflow for recipients on a one-time or recurring basis.
    This flow identifies the recipient, creates a schedule for a workflow with
    the supplied repeat rules, and then lists schedules for that workflow and
    recipient to confirm the schedule was registered. Every step spells out its
    request inline so the flow can be read and executed without opening the
    underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: knockUsersApi
  url: ../openapi/knock-users-api-openapi.yml
  type: openapi
- name: knockSchedulesApi
  url: ../openapi/knock-schedules-api-openapi.yml
  type: openapi
workflows:
- workflowId: schedule-recurring-workflow
  summary: Identify a user, create a schedule, and confirm it was registered.
  description: >-
    Upserts the recipient, creates a schedule for the named workflow with the
    supplied repeat rules, and lists schedules to verify registration.
  inputs:
    type: object
    required:
    - apiKey
    - userId
    - workflowKey
    - repeats
    properties:
      apiKey:
        type: string
        description: Knock secret API key (sk_...) used as a Bearer token.
      userId:
        type: string
        description: The unique identifier of the recipient to schedule.
      email:
        type: string
        description: The primary email address to set on the user.
      workflowKey:
        type: string
        description: The key of the workflow to schedule.
      repeats:
        type: array
        description: The repeat rules describing how often the schedule fires.
        items:
          type: object
      scheduledAt:
        type: string
        description: Optional ISO-8601 start time for the schedule.
      tenant:
        type: string
        description: Optional tenant id to scope the schedule to.
      data:
        type: object
        description: Optional data payload passed into each scheduled run.
  steps:
  - stepId: identifyUser
    description: >-
      Upsert the recipient so the schedule has a valid user to target.
    operationId: identifyUser
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    - name: user_id
      in: path
      value: $inputs.userId
    requestBody:
      contentType: application/json
      payload:
        email: $inputs.email
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      userId: $response.body#/id
  - stepId: createSchedule
    description: >-
      Create a schedule for the workflow and recipient using the supplied repeat
      rules and optional start time.
    operationId: createSchedules
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    requestBody:
      contentType: application/json
      payload:
        workflow: $inputs.workflowKey
        recipients:
        - $steps.identifyUser.outputs.userId
        repeats: $inputs.repeats
        scheduled_at: $inputs.scheduledAt
        tenant: $inputs.tenant
        data: $inputs.data
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      scheduleId: $response.body#/0/id
  - stepId: verifySchedule
    description: >-
      List schedules for the workflow and recipient to confirm the new schedule
      is registered.
    operationId: listSchedules
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    - name: workflow
      in: query
      value: $inputs.workflowKey
    - name: tenant
      in: query
      value: $inputs.tenant
    - name: page_size
      in: query
      value: 50
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      firstScheduleId: $response.body#/entries/0/id
  outputs:
    userId: $steps.identifyUser.outputs.userId
    scheduleId: $steps.createSchedule.outputs.scheduleId