# Channel Configuration — Exported Processed Documents

In the **Exported Processed Documents** section you define **how** the fully processed data reaches your system and **in which format**. Four subpages work together here:

1. **AS2** — connection data for sending via the EDI protocol AS2.
2. **SFTP** — connection data for your own SFTP server. For the Workist-managed SFTP server this page stays empty.
3. **Upload** — the delivery method (SFTP, AS2, API, ERP integration, …), whether Workist actively delivers, target folders and accompanying files.
4. **Output File** — format and content of the generated file (e.g. XML following the Workist schema).

:::warning Default behavior: Workist delivers right away
A new channel delivers even without a saved upload configuration. The defaults are: delivery method **SFTP**, **Push results automatically** on, **Upload original document** on. Every completed document lands as an output file plus PDF in the `/incoming` folder of your area on the Workist-managed SFTP server.

New channels start with automation switched off. Delivery therefore only happens once someone completes a document in assistance. How to test without test documents reaching your production system: [Step 5: Test](/en/docs/implementation-guide/step-5-test.md).
:::

## Prerequisites

- Permission to configure channels (**Manager** and **Admin** roles), see [Users, roles & teams](/en/docs/administration/users-and-roles.md).
- For **AS2**: endpoint, AS2 name and certificates of your AS2 partner. In return, your partner must register Workist's AS2 ID and certificates; you get these from your Workist contact.
- For your **own SFTP server**: host, port, username, host key and a password (or you authorize Workist's public SSH key on your server).
- For the **Workist-managed SFTP server**: your public SSH key under **Settings → SFTP Public Keys**, see [Step 1: Establish connection](/en/docs/implementation-guide/step-1-establish-connection.md) and [Data exchange via SFTP](/en/docs/data-exchange/sftp.md).
- For the **Output File**: nothing is needed for the Workist standard format. Other formats are set up together with your Workist contact.

## Step 1 — AS2 Configuration {#as2}

In the navigation under **Exporting Processed Documents**, select the entry **AS2**.

| Field | Meaning |
| --- | --- |
| **AS2 sender name (leave blank for standard Workist AS2 sender name)** | The AS2 name with which Workist identifies itself to the recipient. As long as the field remains empty, Workist uses its default name, which is sufficient for most cases. |
| **AS2 receiver endpoint** | The URL of the AS2 endpoint on the remote side. |
| **AS2 receiver name** | The AS2 identifier of the remote side. Must match exactly what the remote side assigns; typos lead to rejections. |
| **AS2 receiver verification certificate** | Public certificate (PEM format) with which Workist verifies the digital signatures of the remote side. Provided to you by the recipient. |
| **AS2 receiver encryption certificate** | Public certificate (PEM format) with which Workist encrypts the outgoing messages to the remote side. |
| **Validate receiver certificates?** | Default: on. When enabled, Workist checks the validity of the stored receiver certificates. |

Click **Save**.

:::note
The AS2 configuration alone does **not** make Workist deliver documents. Additionally set the delivery method in the **Upload** section to **AS2**.
:::

What your AS2 partner needs to know:

- Workist **signs and encrypts** every message (encryption 3DES, signature SHA-1) and expects a **synchronous, signed MDN**.
- Every file is sent as a separate message: first the original document, then any additional files, and the output file last.
- On connection errors or an HTTP 5xx response, Workist tries three times in total, 10 seconds apart. After that, the delivery counts as failed, see [Delivery failures](#zustellfehler).
- The original email cannot be sent via AS2.

## Step 2 — SFTP Configuration {#sftp}

In the navigation under **Exporting Processed Documents**, select the entry **SFTP**. You only need this page for your **own** SFTP server.

| Field | Meaning |
| --- | --- |
| **Host (leave blank for workist-managed SFTP server)** | Hostname of your own SFTP server. As long as the field is empty, Workist uses its own managed SFTP server. |
| **Hostkey (leave blank for workist-managed SFTP server)** | Public host key of your server in the format `<type> <key in Base64>`, e.g. `ssh-ed25519 AAAAC3Nza…`, without hostname and without comment. Supported types: `ssh-rsa`, `ssh-dss`, `ecdsa-…`, `ssh-ed25519`. If the field is empty, Workist does not verify the host key. |
| **Port (leave empty for workist-managed SFTP server)** | Port of your own SFTP server. **Required** for your own server: there is no default, not even 22. |
| **Username (leave blank for workist-managed SFTP server)** | SFTP username on your side. |
| **Password (leave blank for workist-managed SFTP server)** | If a password is stored, Workist logs in with it. Without a password, Workist logs in with its own SSH key, which you must authorize on your server. The field does not show the stored value. A new value overwrites the password; an empty field keeps the stored password. It cannot be deleted here. |

:::tip Workist-managed SFTP server (default case)
Leave all fields empty. Instead, add your public SSH key under **Settings → SFTP Public Keys**, see [Step 1: Establish connection](/en/docs/implementation-guide/step-1-establish-connection.md).
:::

How Workist writes the files to the SFTP server (file names, order, overwriting files with the same name) is described in [Data exchange via SFTP](/en/docs/data-exchange/sftp.md).

Click **Save**.

## Step 3 — Upload Configuration {#upload}

In the navigation under **Exporting Processed Documents**, select the entry **Upload**. Here you define **how** the results reach you and which files are sent along. Which fields appear depends on the selected delivery method.

### Choose the delivery method

The first field, **How should the documents be transferred?**, is required. There are six options:

| Delivery method | What happens |
| --- | --- |
| **SFTP** (default) | Workist writes the files to the SFTP server: the Workist-managed one or your own from [Step 2](#sftp). |
| **AS2** | Workist sends the files to the AS2 receiver from [Step 1](#as2). |
| **API** | Your system pulls the results through the [Workist API](/en/docs/data-exchange/api.md). Workist pushes nothing. With [webhooks](/en/docs/data-exchange/webhooks.md), your system can learn when a result is ready. |
| **ERP integration** | Workist pushes the results directly into your connected ERP system, see [Connectors](/en/docs/data-exchange/connectors.md). This method is set automatically when you select the channel in an ERP integration. Workist then switches off the output file serialization, because the data goes straight into the ERP. |
| **Manual** | Results are transferred manually. Workist pushes nothing. |
| **Other** | Another transfer method. Workist pushes nothing. |

### Fields

| Field | Shown for | Default | Meaning |
| --- | --- | --- | --- |
| **Push results automatically** | SFTP, AS2, ERP integration | on | Whether Workist actively delivers the results. When off, Workist still processes documents but sends nothing, and a notice says that pushing is paused. Documents completed during that time are not delivered later either. |
| **Destination folder for generated files** | SFTP | empty = `/incoming` | Folder for the output file. On the Workist-managed server, the folder is located in your area. |
| **Destination folder for outgoing documents** | SFTP | empty = `/incoming` | Folder for the original document and the original email. |
| **Upload original document** | SFTP, AS2 | on | Sends the processed document in addition to the output file. If Workist read the document with text recognition, this is the PDF Workist created in the process, even if the original was, for example, an image. Otherwise, e.g. for XML e-invoices, the original file is sent. The file name is that of the output file, only with a different extension. |
| **Upload original e-mail** | SFTP | off | Sends the original email as an `.eml` file with the same name as the output file. Only for documents that arrived by email. |

:::note Handover via API
Select **API** as the delivery method and save. No further settings are needed: Workist hides the other fields and resets them on save, including **Push results automatically**. If you later switch back to SFTP, AS2 or ERP integration, switch **Push results automatically** on again. The same applies to *Manual* and *Other*.
:::

### Additional files (order channels only)

Order channels have a separate **Additional Files** section below the upload form (for SFTP and AS2). With it, Workist also sends other attachments of the same email that it recognized as one of the selected types:

- **Additional File Types**: Delivery Note, Invoice, Offer, Order Confirmation, Price Requests, Other.
- **Destination folder for additional files** (SFTP only): a separate folder. Empty = the same folder as for outgoing documents.

The files sent along are listed in the Workist XML under `<Additional_Files>`, see [Output format orders](/en/docs/output-formats/orders.md). Whether the section appears depends on how the email inbox is set up; new order channels have it.

Click **Save**.

## Step 4 — Output File {#ausgabedatei}

In the navigation under **Exporting Processed Documents**, select the entry **Output File**.

Here you define **what** Workist writes into the output file, independent of **how** it is transferred.

| Field | Default | Meaning |
| --- | --- | --- |
| **Use Output Mapper** (order channels only) | off | When on, Workist generates the file from a mapping that Workist sets up for you; the serialization fields are hidden. If no mapping exists yet, a warning appears and no output file is generated. Only switch it on in agreement with Workist. |
| **Activate serialization** | on | When off, Workist generates no output file. If SFTP or AS2 with **Push results automatically** is set at the same time, the delivery fails and the document shows an error. For ERP integrations the switch is off by design. |
| **Python serialization modules e.g. …** | empty | Determines the file format. Empty = the product's standard format: Workist XML for orders, price requests and invoices, openTRANS for delivery notes and order confirmations, SAP IDoc BOMMAT07 for lists of services (see [Output formats](/en/docs/output-formats.md)). Other formats are set up by Workist together with you. Do not change the value without consultation. |
| **Additional header data fields** | empty | Further header data fields for the output file that are not included by default. Type the technical field name and press Enter. **Caution:** a field name the format does not know makes output file generation fail for every document. |
| **Additional position line fields** | empty | As above, but for fields per line item. |
| **Include reference to the analyzed file (element `<External_Document_Link>`)** | on | Writes the **file name** of the PDF that Workist sends along into the output file (same name as the output file, extension `.pdf`). It is not a link or URL. Useful together with **Upload original document**. |
| **Include link to the Workbench (element `<Workist_URL>`)** | off | Adds a link with which recipients open the document directly in the Workbench. |
| **Include email sender information (element `<Received_By>`)** | off | Writes the **sender's email address** of the original email into the output file. |
| **Use short external file name** | off | Uses a 22-character instead of a 36-character ID as the file name, for the output file and the PDF sent along. Useful when the receiving system limits file name length. |

Click **Save**.

:::note Before the first save
As long as the page has never been saved, Workist generates the standard file **without** the elements `<External_Document_Link>`, `<Workist_URL>` and `<Received_By>`, even though the form shows the `<External_Document_Link>` switch as on. Save the page once so that your selection applies.
:::

:::note Which fields end up in the output?
With the Workist XML, the output file contains the fields enabled in [Document Processing → Header fields / Line item fields](/en/docs/channel-configuration/document-processing.md), plus the additional fields from this page. Other formats have a fixed structure, see [Output formats](/en/docs/output-formats.md).
:::

## How the Four Pages Work Together

A complete export run after a document is completed:

1. **Output File** generates the file from the extracted values.
2. **Upload** determines the delivery method and whether Workist actively delivers.
3. **AS2** **or** **SFTP** provides the connection data for the chosen method.
4. Optionally, **Upload original document**, **Upload original e-mail** and **Additional Files** add accompanying files.

:::tip Rule of thumb
If a recipient does not receive an expected file, first open the document and read the error message (see [Delivery failures](#zustellfehler)). Then check in this order: *Upload → delivery method* → *Upload → Push results automatically* → *Output File → Activate serialization* → the connection data under **AS2** or **SFTP**.
:::

## Delivery failures {#zustellfehler}

If Workist cannot deliver the results, the document stays in the **Inbox** with an error status. A red banner appears at the top of the document: "Your system rejected the document with the following response:", followed by **Reference**, **Status** and **Message**. For ERP integrations this is the response of your ERP system; for SFTP and AS2 it is the technical error message.

Workist only retries a delivery briefly: it tries to connect to an SFTP server up to ten times, one second apart, and an AS2 delivery three times, ten seconds apart. After that, Workist does not retry automatically.

How to resolve a delivery failure:

| Cause | What to do |
| --- | --- |
| Technical problem, e.g. server unreachable, wrong credentials, wrong target folder | Fix the cause (in **SFTP**, **AS2** or **Upload** if needed). Then, in the document list, select **Retry** in the document's row menu. Workist delivers again, with the current settings. |
| Your system rejects the content, e.g. an unknown customer number | Click **Reopen for assistance** in the banner. The document returns to assistance; correct it and complete it again. Workist then generates the output file again and delivers it. |
| The output file could not be generated, e.g. because of an unknown field name under **Additional header data fields** | Correct the configuration under **Output File**, then select **Retry**. |

**Reprocess** (row menu) is something else: it only applies to documents in assistance and extracts them again with the current configuration and master data. Your previous changes to the document are lost. Use it after changing the field configuration or the master data.

## Frequently Asked Questions

**Can a channel send via AS2 and SFTP at the same time?**
No. There is exactly one delivery method per channel. If you need parallel methods, talk to your Workist contact.

**What happens if the SFTP server is temporarily unreachable?**
Workist tries to connect for about ten seconds. If the server is still unreachable, the delivery fails and the document shows the error banner. There is no later automatic retry. As soon as the server is reachable again, select **Retry** in the row menu of the affected documents, see [Delivery failures](#zustellfehler).

**Are documents delivered later that were completed while "Push results automatically" was off?**
No. Workist does not deliver them after you switch it back on. If needed, you can download the output file from the document's processing history.

**Where do I find the generated file for checking?**
Open the document and click the **Show processing history** icon at the top. In the sidebar, download the file with **Download result**.

## Help and Support

If you have problems with export or delivery, have the following information ready:

- the **channel name** and which configuration it concerns (AS2, SFTP, Upload, Output File),
- the text of the **error banner** from the affected document,
- for AS2: the **AS2 receiver endpoint** and the **AS2 receiver name**,
- for SFTP: **host**, **port** and **username**, and whether you use the Workist-managed or your own SFTP server,
- for output file content: the exact **field name** (technical name from [Document Processing → Header fields](/en/docs/channel-configuration/document-processing/header-fields.md)) and an example of how the value currently looks in the file and how it should look.
