# Step 4: Configure output format

In this step you define **how** a channel's results reach your system and **in which format**. All related settings are in the Channel Configuration under **[Exported Processed Documents](/en/docs/channel-configuration/exported-documents.md)**.

:::warning Delivery is already switched on
Without further settings, a channel delivers every completed document via SFTP to the `/incoming` folder on the Workist-managed SFTP server, as an output file plus PDF. Check the following points before you complete any documents.
:::

## Prerequisites

- The connection from [Step 1](/en/docs/implementation-guide/step-1-establish-connection.md) (SFTP key or API access).
- A channel from [Step 3](/en/docs/implementation-guide/step-3-configure-processing-channel.md).
- Permission to configure channels (**Manager** and **Admin** roles).

## 1. Choose the delivery method

In the channel, open the three-dot menu (⋮) → **Manage channel** → **Upload** and choose the matching method under **How should the documents be transferred?**:

| Your system … | Delivery method | What else you need |
| --- | --- | --- |
| reads files from an SFTP server | **SFTP** (default) | Workist-managed server: only your SSH key from Step 1. Your own server: connection data under **SFTP**. |
| receives EDI messages via AS2 | **AS2** | Connection data and certificates of your AS2 partner under **AS2**. |
| pulls the results itself | **API** | Your API access; optionally [webhooks](/en/docs/data-exchange/webhooks.md) so your system learns when a result is ready. |
| is an ERP system with a Workist connector | **ERP integration** | The configured integration, see [Connectors](/en/docs/data-exchange/connectors.md). The method is set automatically when you select the channel in the integration. |
| gets the data some other way | **Manual** or **Other** | Nothing. Workist pushes nothing with these methods. |

Click **Save**.

## 2. Define the file format

Under **Output File** you define what the file contains. The fields are described in detail in [Step 4 — Output File](/en/docs/channel-configuration/exported-documents.md#ausgabedatei).

- **Format**: if you leave the serialization module field empty, Workist generates the product's standard format, e.g. Workist XML for orders. The structure and fields of each format are described under [Output formats](/en/docs/output-formats.md). Other formats are set up together with Workist.
- **Additional fields**: under **Additional header data fields** and **Additional position line fields** you add further fields. Only enter field names the format knows; an unknown name makes output file generation fail for every document.
- **Optional elements**: `<External_Document_Link>` (file name of the PDF sent along), `<Workist_URL>` (link into the Workbench), `<Received_By>` (sender's email address), plus short file names.
- **Order channels**: if the file should be built from an individual mapping (Output Mapper), Workist sets it up with you.

Click **Save**, even if you did not change anything: only then do the switches for the optional elements apply.

## 3. Define accompanying files and target folders

Back under **Upload**, define which files are sent along with the output file:

- **Upload original document** (default: on): the processed document, usually as a PDF, with the same file name as the output file.
- **Upload original e-mail** (SFTP only): the original email as `.eml`.
- **Additional Files** (order channels only): other attachments of the same email, e.g. delivery notes or offers.
- **Destination folder for generated files** and **Destination folder for outgoing documents** (SFTP only): empty = `/incoming`.

## 4. Set up the connection

| Delivery method | Setup |
| --- | --- |
| SFTP, Workist-managed | Leave the **SFTP** page empty. Your public SSH key must be stored under **Settings → SFTP Public Keys**, see [Step 1](/en/docs/implementation-guide/step-1-establish-connection.md). |
| SFTP, your own server | Under **SFTP**, enter host, port (required), username, host key in the format `<type> <Base64>`, and password. Without a password, Workist logs in with its own SSH key, which you authorize on your server. |
| AS2 | Under **AS2**, enter your partner's endpoint, AS2 name and certificates. Your partner registers Workist's AS2 ID and certificates. Workist signs and encrypts and expects a synchronous MDN. |
| API | No connection data needed in the channel. Your system pulls the results through the [API](/en/docs/data-exchange/api.md). |
| ERP integration | Set up in the integration's settings, see [Connectors](/en/docs/data-exchange/connectors.md). |

## 5. Understand how Workist delivers

- Workist delivers as soon as a document is completed: manually in assistance, or automatically once automation is switched on.
- How the files are created on the SFTP server (file names, order, partial files, overwriting) is described in [Data exchange via SFTP](/en/docs/data-exchange/sftp.md). Set up your import accordingly.
- If delivery fails, the document shows a red error banner. After fixing the cause, you deliver it again, see [Delivery failures](/en/docs/channel-configuration/exported-documents.md#zustellfehler).
- If **Push results automatically** is off, Workist delivers nothing, not even later.

## Checklist

- [ ] Delivery method chosen and saved.
- [ ] **Output File** page saved at least once.
- [ ] Accompanying files and target folders as intended.
- [ ] Connection data entered or SSH key stored.
- [ ] Your system reads from the right folder or pulls the right results.
- [ ] Decided where test results should go (see [Step 5](/en/docs/implementation-guide/step-5-test.md)).

## Where do I find the generated file?

Open a completed document and click the **Show processing history** icon at the top. In the sidebar, download the output file with **Download result**.

## Next step

Test the channel in **[Step 5](/en/docs/implementation-guide/step-5-test.md)**.
