Knock · Arazzo Workflow

Knock Identify User, Set Preferences, and Trigger Workflow

Version 1.0.0

Identify a recipient, apply their notification preferences, then trigger a workflow for them.

1 workflow 3 source APIs 1 provider
View Spec View on GitHub NotificationMessagingInfrastructureWorkflowsCross-ChannelEmailSMSPushIn-AppChatSlackWebhookMCPAI AgentsDeveloper PlatformArazzoWorkflows

Provider

knock-app

Workflows

identify-user-set-preferences-trigger-workflow
Identify a user, set their preference set, and trigger a workflow.
Upserts the user, replaces their preference set with the supplied preferences, and triggers the named workflow for that single recipient.
3 steps inputs: apiKey, channelTypes, data, email, name, preferenceSetId, userId, workflowKey, workflowPreferences outputs: preferenceSetId, userId, workflowRunId
1
identifyUser
Create or update the user record with the supplied identification properties so the recipient exists before preferences are written.
2
setPreferences
Write the complete preference set for the identified user, replacing any existing preferences with the supplied channel types and workflow opt-ins.
3
triggerWorkflow
{$sourceDescriptions.workflowsApi.url}#/paths/~1v1~1workflows~1{key}~1trigger/post
Trigger the named workflow for the identified recipient. Returns a workflow_run_id that can be used to track the resulting messages.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Knock Identify User, Set Preferences, and Trigger Workflow
  summary: Identify a recipient, apply their notification preferences, then trigger a workflow for them.
  description: >-
    The canonical Knock send pattern. The workflow first upserts the recipient
    with identifyUser so Knock has an up-to-date user record, then writes a
    complete preference set for that user so channel and workflow opt-ins are
    respected, and finally triggers a notification workflow scoped to the
    identified recipient. 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: preferencesApi
  url: ../openapi/knock-app-preferences-api-openapi.yml
  type: openapi
- name: usersApi
  url: ../openapi/knock-app-users-api-openapi.yml
  type: openapi
- name: workflowsApi
  url: ../openapi/knock-app-workflows-api-openapi.yml
  type: openapi
workflows:
- workflowId: identify-user-set-preferences-trigger-workflow
  summary: Identify a user, set their preference set, and trigger a workflow.
  description: >-
    Upserts the user, replaces their preference set with the supplied
    preferences, and triggers the named workflow for that single recipient.
  inputs:
    type: object
    required:
    - apiKey
    - userId
    - workflowKey
    properties:
      apiKey:
        type: string
        description: Knock secret API key (sk_...) used as a Bearer token.
      userId:
        type: string
        description: The unique identifier of the user to identify and notify.
      email:
        type: string
        description: The primary email address to set on the user.
      name:
        type: string
        description: The display name to set on the user.
      preferenceSetId:
        type: string
        description: The preference set identifier to update (defaults to "default").
      channelTypes:
        type: object
        description: A map of channel type names to boolean opt-in values.
      workflowPreferences:
        type: object
        description: A map of workflow keys to per-workflow preference settings.
      workflowKey:
        type: string
        description: The key of the workflow to trigger.
      data:
        type: object
        description: Optional data payload passed into the workflow run.
  steps:
  - stepId: identifyUser
    description: >-
      Create or update the user record with the supplied identification
      properties so the recipient exists before preferences are written.
    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
        name: $inputs.name
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      identifiedUserId: $response.body#/id
  - stepId: setPreferences
    description: >-
      Write the complete preference set for the identified user, replacing any
      existing preferences with the supplied channel types and workflow opt-ins.
    operationId: updateUserPreferenceSet
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    - name: user_id
      in: path
      value: $steps.identifyUser.outputs.identifiedUserId
    - name: id
      in: path
      value: $inputs.preferenceSetId
    requestBody:
      contentType: application/json
      payload:
        channel_types: $inputs.channelTypes
        workflows: $inputs.workflowPreferences
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      preferenceSetId: $response.body#/id
  - stepId: triggerWorkflow
    description: >-
      Trigger the named workflow for the identified recipient. Returns a
      workflow_run_id that can be used to track the resulting messages.
    operationPath: '{$sourceDescriptions.workflowsApi.url}#/paths/~1v1~1workflows~1{key}~1trigger/post'
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.apiKey
    - name: key
      in: path
      value: $inputs.workflowKey
    requestBody:
      contentType: application/json
      payload:
        recipients:
        - $steps.identifyUser.outputs.identifiedUserId
        data: $inputs.data
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      workflowRunId: $response.body#/workflow_run_id
  outputs:
    userId: $steps.identifyUser.outputs.identifiedUserId
    preferenceSetId: $steps.setPreferences.outputs.preferenceSetId
    workflowRunId: $steps.triggerWorkflow.outputs.workflowRunId

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/knock-app-identify-user-set-preferences-trigger-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.