# Run your own script or program when a document arrives

Hand a new document to a program you wrote — a PowerShell script, a command-line tool, an API caller — the moment it's filed: register the program in the Configuration Manager, then a Content Capture trigger and a Run External Application action.

Product: content-central · Versions: 7.8+ · Audience: system-administrator · Time: 30 minutes · Last verified: 2026-09-05

Canonical: https://help.ademero.com/content-central/workflow/run-your-own-program-when-a-document-arrives

**When you're done, every new document of this type is handed to your program on the server, with the document passed in as an argument — the escape hatch for integrations that no built-in action covers.**

```plan
scope: document-type
trigger: Content Capture › Content Captured in this Document Type | Any source
action: Run External Application | External Application: the program registered in the Configuration Manager
rule: "Filed → run our program", enabled
```

## When this is the right tool — and when it isn't

Reach for this last. If the other system can watch a folder, [export files to it](/content-central/workflow/drop-approved-documents-into-a-folder-for-another-system); if it's an accounting package, [use its connector](/content-central/workflow/export-approved-invoices-to-accounting). Run External Application is for the cases in between: posting to a web API, pushing a message to a chat tool, calling a line-of-business program that only has a command line.

The program runs on the Content Central server, as the service account, with no desktop. Anything that pops a window, prompts, or needs a mapped drive will hang or fail silently.

## Register the program

1. On the server, open the **Configuration Manager** and go to **External Applications**.

2. Add an entry: a **Name:** (this is what the workflow action will list), the **Location:** of the executable, and the **Argument List:**. Use `$object` in the argument list where the document should be passed — Content Central substitutes the workflow's document at run time.

3. Apply. Details of the screen and its scoping: [Configuration Manager: what lives where](/content-central/administration/configuration-manager-what-lives-where).

> **NOTE:** Test the command line by hand first, running as the service account, with a real file path in place of `$object`. Workflow won't tell you the script's error text.

## Build the trigger

1. Go to **Administration** > **Catalogs & Document Types**, pick the **Catalog** and **Document Type**, click the **Workflow** tile, then **Triggers** > **New Trigger**.

2. **Type:** `Content Capture` and `Content Captured in this Document Type`. **Trigger Name:** `New document filed`. **Save**.

## Build the action

1. Click **Actions** > **New Action**. **Type:** `Run External Application`. **Action Name:** `Run our program`.

2. Choose the entry under **External Application:**. If the form says `There are no available external applications.`, the Configuration Manager step wasn't applied, or the entry is scoped to a different catalog or document type.

3. Click **Save**.

## Wire the rule

1. Click **Rules** > **New Rule**. **Rule Name:** `Filed → run our program`.

2. **Add Trigger:** `New document filed`. **Add Action:** `Run our program`. **Apply**.

## Test it

1. Have the program write a line to a log file of its own every time it runs, including the argument it received. File one test document.

2. Read that log on the server, and the document's **View History**.

**What you should see:** a new log line with the document reference, and the rule in the history. If the history shows the rule ran but the log is empty, the program failed to start: path, permissions of the service account, or an argument the program didn't accept.

## Variations

| Want this instead | Change this |
| --- | --- |
| Run after approval rather than on filing | Trigger **Approval Processes** › **Movement on Process**, `Approval by Final Member` |
| Run nightly over a set of documents | A scheduled **Content Query** trigger — the program runs once per matching document |
| Pass field values, not just the document | Export a data file first with **Export Data** and have the program read it, or have the program query the Content Central API |
| Let a *person* run it from the document menu instead of workflow | The same External Applications entry can back a custom menu item |
| Convert the file format before handing it off | Action **Format Convert** earlier in the same rule |

## What's next

- [Configuration Manager: what lives where](https://help.ademero.com/content-central/administration/configuration-manager-what-lives-where)
- [Drop approved documents into a folder for another system](https://help.ademero.com/content-central/workflow/drop-approved-documents-into-a-folder-for-another-system)
- [Connect another system to Content Central](https://help.ademero.com/content-central/integrations/connect-another-system-to-content-central)
