Give an agent flow a knowledge base to search
workbench_flows_attach_knowledge_baseAttaches a knowledge base to an AGENT flow's draft, the same way picking it in the agent editor does: a docs knowledge base becomes a search tool the model calls when a question needs it; a tabular one also puts its tables in the prompt and adds a query tool. The flow needs a system prompt (scaffold it with one). Attaching one that's already there changes nothing. Do it BEFORE workbench_flows_publish: a published version is what interfaces and schedules run, so attach, try it with workbench_flows_run, then publish — and if something already pins an older version (an interface grant), re-grant the new version. Tell the model in its system prompt what the knowledge base holds and when to search it. May return needs_confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flowId | Yes | The agent flow, from workbench_flows_scaffold or workbench_flows_list. | |
| workspace | No | Workspace slug. Personal tokens with no default workspace MUST pass this; tokens with a default can override per call. Ignored for workspace API keys. | |
| approvalId | No | Approval id from a prior needs_confirmation response. Omit on the first call. | |
| knowledgeBaseId | Yes | The knowledge base id, from workbench_kb_create or workbench_kb_list. |