> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/workflows/designing-workflows/processes/shape-repository/external-api-task.md).

# External API task

The external API task allows your workflows to securely interact with external REST APIs.

<img src="/files/bN04GGw4MDbcMNMgdlvC" alt="The external API task BPMN element in Collibra Workflow Designer" width="25%">

{% hint style="info" %}
This task cannot connect to Collibra APIs. Use the [Collibra API task](/workflows/designing-workflows/processes/shape-repository/collibra-api-task.md) instead.
{% endhint %}

## How the external API task works

When the workflow reaches an external API task, the Collibra Edge Session Manager sends the request defined in the task to the external API. The Session Manager processes the request using the configured connection details, authentication, and task-specific details.

The final request URL is constructed by concatenating the **Host** defined in the Edge HTTP connection with the **Path** defined in the external API task. For example, a host of *<https://api.example.com>* and a path of */v1/resource* result in a request to *<https://api.example.com/v1/resource>*.

{% hint style="info" %}
Because the request originates from the Edge Site, the Edge Site must have network access to the target host, not Collibra. If the connection fails, verify that the Edge Site can reach the external endpoint.
{% endhint %}

The response from the external API is captured and stored in a process variable. The variable name is determined as follows:

* `<Model_ID>ResponseBody`, for example `HttpTask_1ResponseBody`, if you have not specified a **Response variable name**.
* The **Response variable name** defined in the external API task configuration.

### Execution and response handling

The external API task treats all HTTP responses as successful, including `4xx` and `5xx` status codes. The workflow always continues to the next task, regardless of the response status code. To act on a specific status code, you must explicitly inspect the response in your workflow design.

The API tasks are always executed as [asynchronous activities](/workflows/designing-workflows/processes/process-execution.md). As a result, any changes made in activities before these tasks are committed to Collibra, including any preparation of the input for the API task.

The API task component treats all response status codes as successful, including `4xx` and `5xx`. To handle a particular response status code, use the **Handle status codes** attribute and place an **ErrorBoundaryEvent** with the appropriate error code, such as *HTTP400* on the API task component. This approach provides flexibility to define an error handling pathway, which may include actions such as:

* Ending the workflow.
* Logging relevant information.
* Assigning a task to a system administrator for further investigation.

Using the **Fail status codes** property causes the workflow to enter an error state as it attempts to revert to the last successful state. Due to the asynchronous execution of the API task, the workflow is unable to progress further, effectively halting its execution.

### Workflow exceptions

The workflow stops with an error at the instance level in case of an exception such as:

* Pre-validation:
  * Unsupported Request Format
  * Edge HTTP Connection Not Provided
  * Edge HTTP Connection Not Found
* Request Sending Error
* Request Timeout
* Response Size Exceeded

### Important considerations

* The request timeout is limited to 10 seconds.
* The external API task runs in asynchronous mode only.
* The maximum allowed response size is 100KB.
* The supported request and response formats are XML, JSON, and plain text.
* Retry is limited to 3 times, only if the HTTP request fails to be sent, since `4xx` and `5xx` response codes are also considered successful.
* Any `Authorization` header defined in the **Headers** configuration of the task is removed. You must configure authentication through the Edge HTTP connection.
* The Edge vault stores credentials for Edge capabilities only and is not accessible from workflow HTTP tasks.

### Troubleshooting null response from a valid endpoint

If an external API task consistently returns a `null` response even though the same request succeeds in a REST client such as Postman, the target API may not support HTTP response streaming. By default, the Edge Session Manager streams responses. To disable streaming, a Collibra or Edge administrator can run the following [Edge CLI](https://productresources.collibra.com/docs/collibra/latest/Content/Edge/EdgeSiteManagement/co_edge-cli.htm) command:

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><pre><code>edgecli update --set edgeSessionManager.sessionManager.externalApiTask.useRequestStreaming=false
</code></pre></td></tr></tbody></table>

{% hint style="info" %}
Disabling streaming affects all external API tasks on the Edge Site. APIs that send real-time updates, perform long-running queries, or send data that arrives in chunks may experience degraded functionality or performance. Instead of sending incremental updates or streamed data, these APIs would need to wait until they have the full response before any data is returned.
{% endhint %}

## Prerequisites

You have created an **HTTP connection** on an Edge or Collibra Cloud site in Collibra.

<details>

<summary>Show me how</summary>

### Prerequisites

* You either created and installed an Edge site or were granted a Collibra Cloud site.
* You have a global role that has the **System administration** or **Manage connections and capabilities** global permission.

### Steps

{% stepper %}
{% step %}
Open a site.

1. On the main toolbar, click <img src="/files/M6nz1hzJEDs6R4z6SoGf" alt="Products icon" data-size="line"> → <img src="/files/enFqaM2f7lPrOzgBCLEP" alt="Cogwheel icon" data-size="line"> **Settings**.\ <i class="fa-chevrons-right">:chevrons-right:</i> The **Settings** page opens.
2. In the tab pane, click **Edge**.\ <i class="fa-chevrons-right">:chevrons-right:</i> The **Sites** tab opens and shows a table with an overview of your sites.
3. In the site overview, click the name of a site.\ <i class="fa-chevrons-right">:chevrons-right:</i> The site page appears.
   {% endstep %}

{% step %}
In the **Connections** section, click **Create connection**.\ <i class="fa-chevrons-right">:chevrons-right:</i> The **Create connection** page appears.
{% endstep %}

{% step %}
Select the **HTTP connection**:

{% tabs %}
{% tab title="OAuth 2.0" %}
Connect to an external REST API using OAuth 2.0 authentication with a [Client Credentials grant](https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/).

{% hint style="info" %}
Only the Client Credentials grant type is supported. Credentials are sent in the **Authorization** header using the Basic method. Sending credentials in the request body (`client_secret_post`) is not supported.
{% endhint %}

| Field                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Required                                                            |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| Name                 | <p>The name of the Edge HTTP connection.</p><div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p>Use this value in the external API task as the <strong>Edge HTTP connection name</strong> property to identify the connection.</p></div>                                                                                                                                                                                                                                                                                                                                                                                                                          | <img src="/files/yOJp2T5k8WTMGzeFfzgO" alt="" data-size="line"> Yes |
| Description          | A description for the connection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | <img src="/files/YFVkvH3rJ92clcsnvIR3" alt="" data-size="line"> No  |
| Vault                | The vault where you store your credentials.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | <img src="/files/YFVkvH3rJ92clcsnvIR3" alt="" data-size="line"> No  |
| Client ID            | The unique identifier assigned to each client application by the authorization server when the application is registered.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | <img src="/files/yOJp2T5k8WTMGzeFfzgO" alt="" data-size="line"> Yes |
| Client secret        | <p>The confidential string of characters used to authenticate the identity of the client application on the authorization server.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>If your client secret contains special characters such as <code>+</code>, <code>=</code>, or <code>&</code>, some identity providers may reject the token request. This occurs when the identity provider does not decode the percent-encoded secret that Collibra sends per RFC 6749. If token requests fail with a 401 error and your credentials are correct, regenerate the client secret in your identity provider until you obtain an alphanumeric-only value.</p></div> | <img src="/files/yOJp2T5k8WTMGzeFfzgO" alt="" data-size="line"> Yes |
| Access token URI     | The endpoint on the authorization server where the client application can exchange an authorization grant for an access token, for example *<https://api.example.com/oauth/token>*.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | <img src="/files/yOJp2T5k8WTMGzeFfzgO" alt="" data-size="line"> Yes |
| Scopes               | A list of space delimited specific permissions that the client application is requesting, for example *read\_data read\_pii\_data*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | <img src="/files/YFVkvH3rJ92clcsnvIR3" alt="" data-size="line"> No  |
| Host                 | The protocol and domain name of the server, for example *<https://api.example.com>*.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | <img src="/files/yOJp2T5k8WTMGzeFfzgO" alt="" data-size="line"> Yes |
| Test connection path | <p>The path for testing this connection with a <code>GET</code> call, for example <em>/v1/health</em>.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>You can only test a connection after saving the connection details.</p></div>                                                                                                                                                                                                                                                                                                                                                                                                                             | <img src="/files/YFVkvH3rJ92clcsnvIR3" alt="" data-size="line"> No  |
| {% endtab %}         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                     |

{% tab title="Basic Auth" %}
Connect to an external REST API using basic access authentication.

| Field                | Description                                                                                                                                                                                                                                                                      | Required                                                            |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| Name                 | <p>The name of the Edge HTTP connection.</p><div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p>Use this value in the external API task as the <strong>Edge HTTP connection name</strong> property to identify the connection.</p></div> | <img src="/files/yOJp2T5k8WTMGzeFfzgO" alt="" data-size="line"> Yes |
| Description          | A description for the connection.                                                                                                                                                                                                                                                | <img src="/files/YFVkvH3rJ92clcsnvIR3" alt="" data-size="line"> No  |
| Vault                | The vault where you store your credentials.                                                                                                                                                                                                                                      | <img src="/files/YFVkvH3rJ92clcsnvIR3" alt="" data-size="line"> No  |
| Username             | The username for this connection or the vault parameters for the username.                                                                                                                                                                                                       | <img src="/files/yOJp2T5k8WTMGzeFfzgO" alt="" data-size="line"> Yes |
| Password             | The password for this connection or the vault parameters for the password.                                                                                                                                                                                                       | <img src="/files/yOJp2T5k8WTMGzeFfzgO" alt="" data-size="line"> Yes |
| Host                 | The protocol and domain name of the server, for example *<https://api.example.com>*.                                                                                                                                                                                             | <img src="/files/yOJp2T5k8WTMGzeFfzgO" alt="" data-size="line"> Yes |
| Test connection path | <p>The path for testing this connection with a <code>GET</code> call, for example <em>/v1/health</em>.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>You can only test a connection after saving the connection details.</p></div>    | <img src="/files/YFVkvH3rJ92clcsnvIR3" alt="" data-size="line"> No  |
| {% endtab %}         |                                                                                                                                                                                                                                                                                  |                                                                     |

{% tab title="No Auth" %}
Connect to an external REST API that does not require authentication.

| Field                | Description                                                                                                                                                                                                                                                                                                        | Required                                                            |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------- |
| Name                 | <p>The name of the Edge HTTP connection.</p><div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p>Use this value in the external API task as the <strong>Edge HTTP connection name</strong> property to identify the connection.</p></div>                                   | <img src="/files/yOJp2T5k8WTMGzeFfzgO" alt="" data-size="line"> Yes |
| Description          | A description for the connection.                                                                                                                                                                                                                                                                                  | <img src="/files/YFVkvH3rJ92clcsnvIR3" alt="" data-size="line"> No  |
| Vault                | The vault where you store your connection details.                                                                                                                                                                                                                                                                 | <img src="/files/YFVkvH3rJ92clcsnvIR3" alt="" data-size="line"> No  |
| Host                 | The protocol and domain name of the server, for example *<https://api.example.com>* or the vault parameters for the host.                                                                                                                                                                                          | <img src="/files/yOJp2T5k8WTMGzeFfzgO" alt="" data-size="line"> Yes |
| Test connection path | <p>The path for testing this connection with a <code>GET</code> call, for example <em>/v1/health</em> or the vault parameters for the path.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>You can only test a connection after saving the connection details.</p></div> | <img src="/files/YFVkvH3rJ92clcsnvIR3" alt="" data-size="line"> No  |
| {% endtab %}         |                                                                                                                                                                                                                                                                                                                    |                                                                     |
| {% endtabs %}        |                                                                                                                                                                                                                                                                                                                    |                                                                     |
| {% endstep %}        |                                                                                                                                                                                                                                                                                                                    |                                                                     |

{% step %}
Click Create.\ <i class="fa-chevrons-right">:chevrons-right:</i> The connection is added to the Edge or Collibra Cloud site.
{% endstep %}
{% endstepper %}

</details>

## General properties

| Property                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Model ID                  | The unique identifier of the element within the process model.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Name                      | The name of the element displayed in the diagram.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Documentation             | A description and any additional information about this element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Edge HTTP connection name | The name of the Edge HTTP connection that contains the connection details and credentials.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Request method            | <p>The method of the request: <code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>DELETE</code>, or <code>PATCH</code>.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Values are case sensitive and must not contain leading or trailing spaces.</p></div>                                                                                                                                                                                                                                                                                                                                                                                  |
| Request headers           | <p>Line-separated HTTP request headers, such as <code>Content-Type:application/json</code>.</p><div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p>The following headers are not supported and are removed:</p><ul><li><code>Access-Control-Request-Method</code></li><li><code>Authorization</code></li><li><code>Connection</code></li><li><code>Upgrade</code></li><li><code>Via</code></li><li><code>Content-Length</code></li><li><code>Host</code></li><li><code>Origin</code></li><li><code>Trailer</code></li><li><code>Transfer-Encoding</code></li><li><code>Content-Transfer-Encoding</code></li><li><code>Keep-Alive</code></li></ul></div> |
| Request path              | <p>The relative path of the API endpoint.</p><p>You can use expressions such as <code>${requestPath}</code> or <code>/api/endpoint/${expression}</code>.</p><p>You can add query parameters in <em>key=value</em> format by appending them after a <code>?</code> to the path and separating multiple parameters by <code>&</code>, for example <code>/api/endpoint?limit=10\&status=${expression}</code>.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Values are case sensitive.</p></div>                                                                                                                                                        |
| Request body              | <p>The body of the request, such as a JSON file which can also contain expressions, for example: <code>{'clientId': ${clientId}, 'name': ${name}}</code>.</p><p>The supported formats are: XML, JSON, and plain text.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>To avoid unexpected behavior, do not send a body with <code>GET</code> or <code>DELETE</code> requests.</p></div>                                                                                                                                                                                                                                                                |
| Fail status codes         | <p>A list of HTTP response status codes to fail the request and throw a runtime exception. You can set code ranges with an <em>X</em>, for example <code>400, 404, 5XX</code>.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><ul><li>The API task component treats all response status codes as successful, including <code>4xx</code> and <code>5xx</code>.</li><li>Use <strong>Handle status codes</strong> to provide an error handling pathway and prevent the workflow from being stuck.</li></ul></div>                                                                                                                                           |
| Handle status codes       | <p>A list of status codes for which the task will throw a BPMN error, which can be caught by a boundary error event. You can set code ranges with an <em>X</em>, for example <code>400, 404, 5XX</code>.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Status codes defined here take precedence if the same status codes are defined in the <strong>Fail status codes</strong> attribute.</p></div>                                                                                                                                                                                                                                                 |
| Response variable name    | <p>The name of the process variable to store the HTTP response.</p><p>If not specified, the response is stored in the default variable <code>\<HTTP\_Task\_Model\_ID>ResponseBody</code>, for example <code>httpTask1ResponseBody</code>.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The supported response formats are XML, JSON, and plain text.</p></div>                                                                                                                                                                                                                                                                                      |

## Detail properties

| Property               | Description                                                                                                                                                                                                                                          |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Save request variables | Determines whether all the runtime fields related to the request should be stored as process variables, such as header, path, encoding, or body. By default, only fields related to the response are stored as variables.                            |
| Save response details  | Determines whether all the fields related to the response that are not the actual response in the body should be stored as process variables, including HTTP status, headers, and so on. By default, only the response body is stored as a variable. |
| Result variable prefix | A prefix that should be prepended to all the variables for easier grouping, which is useful when there are different API tasks.                                                                                                                      |

## Advanced properties

| Property            | Description                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Skip expression     | <p>An expression which is evaluated before executing the task. If it evaluates to <code>true</code>, the task is skipped.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>You must opt-in to enable this feature by setting a process variable <code>\_FLOWABLE\_SKIP\_EXPRESSION\_ENABLED</code> with the Boolean value <code>true</code>.</p></div> |
| Execution listeners | <p>Allows you to invoke Java logic after certain events:</p><ul><li><strong>Start</strong>: Executes after the activity has been started.</li><li><strong>End</strong>: Executes after the activity was completed.</li><li><strong>Transition</strong>: When defined on a sequence flow, executes once the flow is transition is taken.</li></ul>                                              |

## Visual properties

| Property         | Description                                         |
| ---------------- | --------------------------------------------------- |
| Font size        | The font size of the element in the diagram.        |
| Font weight      | The font weight of the element in the diagram.      |
| Font style       | The font style of the element in the diagram.       |
| Font color       | The font color of the element in the diagram.       |
| Background color | The background color of the element in the diagram. |
| Border color     | The border color of the element in the diagram.     |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.collibra.com/workflows/designing-workflows/processes/shape-repository/external-api-task.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
