---
title: "Captain Integration"
description: "Captain is managed file search for AI agents: it indexes files, text, web pages and Amazon S3 objects into collections and answers plain-language searches with cited passages. Agents keep collections current as documents arrive, search them before acting, and react when an indexing job completes or fails."
url: https://flowrunner.ai/integrations/captain
date_modified: 2026-12-02T08:59:36-08:00
---

# Captain

[Vector Stores & AI Infra](https://flowrunner.ai/integrations/category/vector-stores-ai-infra)

Captain is managed file search for AI agents: it indexes files, text, web pages and Amazon S3 objects into collections and answers plain-language searches with cited passages. Agents keep collections current as documents arrive, search them before acting, and react when an indexing job completes or fails.

[Verified](https://flowrunner.ai/integrations/verified "What does verified mean?") · 8 triggers · 16 actions · API key · available

[Captain website](https://captain.dev/) · [Platform Documentation](https://docs.captain.dev/) · Capability data verified 2026-12-01

1.  A file is uploaded to a watched Box folder
2.  Box Download File saves the file to FlowRunner
3.  List Documents looks for an earlier copy by Box file ID
4.  Index File adds it to the Captain collection
5.  On Indexing Job Completed confirms it is searchable
6.  Slack tells the team the file is now searchable
7.  Folder owner decides if a new version replaces the old

## What This Integration Enables

Captain is agent infrastructure for file search, from a YC W26 team. It indexes files from storage buckets, cloud drives and the web into collections, then answers plain-language searches with ranked passages. Every result comes with the exact snippet the agent saw, so an answer can cite its source. Captain treats search as a tool an agent calls, and that is the right shape for retrieval. An agent that can only answer from what it found, and shows where it found it, is an agent a team can check.

FlowRunner agents call Captain as tools. They create collections and index files, text, public links, and Amazon S3 files or whole folders. Indexing runs in the background and returns a job ID. Get Job Status and five signed webhook triggers report how each job ended. Agents search one collection or up to 10 at once, and read, tag and delete documents. Parse Document turns a PDF or Word file into the same passages indexing makes, without storing them. When a step would remove or overwrite what the team's answers cite, the agent stops and asks the person who owns those documents. That is [human-in-the-loop](https://flowrunner.ai/concepts/human-in-the-loop) placed where the knowledge changes.

The connection takes an API key from Captain Studio. Indexing from S3 also takes AWS keys in the connection or a cross-account IAM role. Each flow's triggers register one webhook endpoint with Captain, and an organization can hold 20.

### Without FlowRunner

**Answers from memory**: Support and ops staff answer from what they remember of a policy, or go digging through folders

**Indexing by hand**: Someone has to remember to add each new contract or policy to the search tool

**Silent indexing failures**: A file that failed to index never shows up in search, and nobody knows why

### With FlowRunner

**Answers with the passage**: Each suggested answer carries the exact passage, document and page it came from

**Indexed when it lands**: A file uploaded to the folder is indexed and searchable without anyone asking

**Failures in the channel**: A failed or partial job reaches the team with each file's error, and lands in a log

## Flows you can build with Captain

### [New Box files searchable in Captain](https://flowrunner.ai/flows/captain-new-box-files-indexed)

Two flows share this job. In the first, On Folder Event in [Box](https://flowrunner.ai/integrations/box) starts the flow when a file is uploaded to the team's Policies folder. Download File saves it to FlowRunner file storage and returns its URL. The agent runs List Documents with a metadata filter on the Box file ID, to see whether an earlier version is already in the collection. A new file goes straight to Index File, tagged with the Box file ID, folder and uploader as custom metadata. When an earlier version exists, the agent asks the folder owner in [Slack](https://flowrunner.ai/integrations/slack) first. The owner chooses to replace it, keeping its document ID, or to index the new file beside it, and Index File runs with Replace Existing Document set to match. It matches on file name, so the replacement carries the same name as the version it replaces. In the second flow, On Indexing Job Completed fires once Captain has made the job's files searchable, Get Job Status reads which files they were, and Send Message To Channel posts them to the team's channel in Slack with the uploader and folder from the metadata.

[See the flow and import it](https://flowrunner.ai/flows/captain-new-box-files-indexed)

[](https://flowrunner.ai/flows/captain-new-box-files-indexed)

### [Zendesk tickets answered from your documents](https://flowrunner.ai/flows/captain-zendesk-tickets-answered-from-documents)

On Ticket Event in [Zendesk](https://flowrunner.ai/integrations/zendesk) starts the flow when a new ticket arrives. The agent runs Search Collection with the ticket's subject and first comment against the help-center and policy collection. Captain returns the best passages with their documents, pages and scores. The agent drafts a suggested answer from the top passages only, and adds it to the ticket as an internal note with Add Comment To Ticket. Each point in the note names its document and page. When no passage scores well, the note says so instead of guessing. The support agent checks the cited page and writes the reply to the customer. Captain does not charge for queries, so the flow can run on every new ticket.

[See the flow and import it](https://flowrunner.ai/flows/captain-zendesk-tickets-answered-from-documents)

[](https://flowrunner.ai/flows/captain-zendesk-tickets-answered-from-documents)

### [Indexing problems reach the team](https://flowrunner.ai/flows/captain-indexing-problems-reach-the-team)

On Indexing Job Completed With Errors and On Indexing Job Failed start the flow. Get Job Status returns the job's progress, credit usage and per-file results. The agent picks out each file that failed and its error, and posts them to the #data channel in Slack with Send Message To Channel. It logs one row per file in [Google Sheets](https://flowrunner.ai/integrations/google-sheets) with Add Row, with the collection, file name, error and job ID. A file that keeps failing shows up in the log more than once, so the team sees a pattern rather than a one-off. When a whole job fails, the error code from the trigger goes in the message.

[See the flow and import it](https://flowrunner.ai/flows/captain-indexing-problems-reach-the-team)

[](https://flowrunner.ai/flows/captain-indexing-problems-reach-the-team)

## Human-in-Loop Highlight

The gate sits on Delete Document, because it removes a document and every passage in it from the collection, and there is no undo. Captain's own bucket sync drops deleted files by itself. A file a flow added with Index File stays until a flow removes it. So once a week the agent compares the Policies folder in Box, read with List Folder Items, against the collection's documents and their Box file IDs. For each document whose file has left the folder, it reads the document with Get Document and asks the knowledge owner in Slack: "Refund Policy 2025.pdf is no longer in the Box Policies folder. Captain still holds it in Support Answers: 41 passages, tagged policy\_area refunds. No newer refund policy is in the collection. Delete it from Captain, or keep it and tag it retired so searches can leave it out?" On delete, the agent calls Delete Document. On keep, Update Document Metadata adds the retired tag, and the support flow's Search Collection filters it out. A file pulled from a folder by mistake can come back in Box. A deleted document has to be indexed again from the start, so a person makes that call.

Agent processes routinely

Detects exception requiring judgment

Clear match Continues automatically

Ambiguous Routes to human via Slack

Human decides

Agent resumes with decision

## Agent Capabilities

16 actions

### Search

2

-   **Search Collection** Searches a collection in plain language and returns the best matching passages, with their documents, pages and scores. A metadata filter narrows the search, for example to one policy area or year. Used as the agent's lookup before it answers or acts.
-   **Search Several Collections** Runs one search against up to 10 collections at once and returns a separate ranked list for each, in the order given. Used when the answer could sit in contracts, policies or product docs, each kept in its own collection.

### Collections

2

-   **List Collections** Lists the collections in the organization, a page at a time, with their IDs and document counts. Used to find the right collection or report on what is indexed.
-   **Create Collection** Creates a collection with the given name. If the name already exists, it returns that collection instead of failing. Used to set up a collection per team, customer or project from a flow.

### Indexing

6

-   **Index File** Downloads a file from a URL, such as a file saved by an earlier step, and uploads it into a collection with custom metadata. Indexing runs in the background and the action returns the job ID. Replace Existing Document decides whether a file with the same name replaces the earlier document or is skipped. Used when a file lands in a drive or arrives as an attachment.
-   **Index Text** Saves text as a .txt document in a collection and indexes it, returning the job ID. Used for meeting notes, ticket resolutions or any text a flow produces.
-   **Index URLs** Has Captain download documents from public links and index them into a collection, returning the job ID. Used to keep public help pages or published policies searchable.
-   **Index S3 File** Indexes one file from an Amazon S3 bucket into a collection, reading it with the AWS keys from the connection or a cross-account IAM role. Returns the job ID. Used when an upload to S3 should become searchable.
-   **Index S3 Directory** Indexes every file in a folder of an S3 bucket, subfolders included, into a collection. Returns the job ID. Used to load an archive in one step.
-   **Get Job Status** Returns an indexing job's status, progress, credit usage and per-file results, with a cursor to page through the files. Used to see which files failed and why.

### Documents

4

-   **List Documents** Lists the documents in a collection, a page at a time. A metadata filter finds the document that carries an ID from your own system, such as a Box file ID. Used to check for an earlier version before indexing again.
-   **Get Document** Returns one document with its metadata, summary, tags and all of its passages. Used to show a person what a document holds before a decision about it.
-   **Update Document Metadata** Merges keys into a document's custom metadata and leaves the other keys as they are. A key set to null is removed. Used to tag a document as retired, reviewed or owned by a team.
-   **Delete Document** Deletes one document and its passages from a collection. Other documents with the same file name are not touched. Used after a person confirms a document should leave search.

### Parsing

2

-   **Parse Document** Starts a parse job that turns a PDF or Word file into the same passages indexing produces, without storing them in a collection. Returns the job ID. Used to feed clean passages to another database or an extraction step.
-   **Get Parse Job** Returns a parse job's status and, once it completes, its passages in order. It can wait up to 50 seconds for the job to finish. Used to pick up the passages right after Parse Document.

## Triggers

8 triggers

### Event Triggers

8

-   **On Indexing Job Completed** Starts a flow when Captain reports an indexing job finished with every file indexed or skipped, so all of it is searchable. Used to tell a team a file is ready, or to start the next step that searches it.
-   **On Indexing Job Completed With Errors** Starts a flow when an indexing job finishes and at least one file failed. The files that succeeded are searchable, and Get Job Status lists the failures. Used to route the failed files to whoever owns them.
-   **On Indexing Job Failed** Starts a flow when an indexing job fails, with Captain's error code. Used to alert the team and log the failure.
-   **On Indexing Job Timed Out** Starts a flow when an indexing job runs past its time limit. Used to retry a large job or flag it for a person.
-   **On Indexing Job Canceled** Starts a flow when an indexing job is canceled. Used to keep a log of indexing work in step with what actually ran.
-   **On Parse Job Completed** Starts a flow when a parse job finishes. Get Parse Job with the job ID returns its passages. Used to pass parsed passages on to the next system.
-   **On Parse Job Failed** Starts a flow when a parse job fails, with Captain's error code. A failed parse job is not billed. Used to flag a document that could not be parsed.
-   **On Parse Job Canceled** Starts a flow when a parse job is canceled. A canceled parse job is not billed. Used to close out the request that started it.

## Frequently asked questions

### What can FlowRunner do with Captain?

FlowRunner agents can run Search Collection, Search Several Collections, and List Collections in Captain, plus 13 more actions.

### Does connecting Captain to FlowRunner require OAuth?

No. Captain connects to FlowRunner with an API key, no OAuth flow required.

### Can Captain trigger a FlowRunner workflow automatically?

Yes. Captain supports 8 triggers that can start a FlowRunner workflow automatically.

**Work at Captain?** This integration exposes Captain to AI agents on every FlowRunner plan, including through MCP, at no cost to you. [See what FlowRunner offers integration partners](https://flowrunner.ai/integrations/partners), including how to keep this page current.

## Need a custom Captain automation? Our team can build it for you.

Tell us the process. Our implementation team at Midnight Flow builds it around how you work, tests it on your real data, and keeps it running, in your own FlowRunner workspace.

[Have us build it](https://midnightflow.ai/packages/custom?utm_source=flowrunner.ai&utm_medium=referral&utm_campaign=general&utm_content=integrations.aside&utm_term=captain)

---
Markdown version of https://flowrunner.ai/integrations/captain. Site index: https://flowrunner.ai/llms.txt
