Workflows-as-tools

Learn how the Agent Toolkit exposes your workflows as tools that your AI Agents can invoke to power cross-channel user messaging, without any integration logic.

By default the agent toolkit will expose each of your workflows as a tool that your agents can invoke to power cross-channel messaging.

If you have a workflow (comment-created) within your Knock account, the agent toolkit will expose a trigger_comment_created_workflow tool that your agents can invoke to send a notification.

You can think of this as exposing a well-scoped API endpoint that describes exactly how the workflow should be triggered to the LLM/AI Agent. That makes it trivial to build agents that can trigger complex cross-channel messaging flows, with no integration logic.

Configuring which workflows are exposed as tools

When using the agent toolkit, you can optionally configure exactly which workflows are exposed as tools. To do so, you can set the permissions.workflows.run property on the agent toolkit configuration.

In the below example, we're ensuring that only the comment-created, task-completed, and welcome-user workflows are exposed as tools to the LLM:

If you wish to omit exposing any workflows as tools, you can set the permissions.workflows.run property to an empty array:

Describing the trigger data for each workflow

The trigger data tool created for each workflow exposes the workflow's trigger data JSON schema to the LLM to describe the data payload required to trigger the workflow, and what the shape of that expected data should be.

This allows you to define an explicit contract for your workflow and ensure that the LLM is passing in the correct data when invoking the workflow to send notifications, adding a safe guard so that workflows cannot be triggered with incorrect data supplied.

Tips for exposing workflows to LLMs

Example prompts for triggering workflows

Here are some example prompts for invoking your workflows as tools in your AI Agent:

  • "Trigger the comment-created workflow for the current user."
  • "When the task completes, notify the user using the task-completed workflow."
  • "Send all of the users in the engineering team a welcome message using the welcome-user workflow."