> For the complete documentation index, see [llms.txt](https://docs.digibee.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digibee.com/documentation/development-cycle/overview/how-pipeline-execution-works.md).

# How pipeline execution works

Learn how the Pipeline Engine runs your pipelines on the Digibee Integration Platform and how size, consumers, and replicas affect performance.

## **What the Pipeline Engine does**

The Pipeline Engine interprets and runs the pipelines you build on the Platform. When you deploy a pipeline, you define how much capacity it gets. Understanding how execution works helps you choose the right settings.

## **Execution architecture**

Each pipeline runs in its own container on Kubernetes. This gives you:

* **Isolation:** Each pipeline uses its own CPU and memory.
* **Safety:** Pipelines don't interfere with each other unless you configure them to.
* **Independent scaling:** You can add or remove replicas of each pipeline based on demand.

Triggers receive the invocations and send the messages to a queue. The pipeline consumes the messages from this queue.

## **Pipeline size**

The size defines the resources of each replica. It is the way to scale a pipeline vertically.

| Size       | Consumers | CPU          | Memory |
| ---------- | --------- | ------------ | ------ |
| **Small**  | 10        | 20% of 1 CPU | 64 MB  |
| **Medium** | 20        | 40% of 1 CPU | 128 MB |
| **Large**  | 40        | 80% of 1 CPU | 256 MB |

CPU defines how many processing cycles the pipeline can use. Memory defines how much data the pipeline can process and store during execution.

## **Consumers and concurrent executions**

Consumers define how many messages a replica can process at the same time. For example, a pipeline with 10 consumers processes 10 messages in parallel, while a pipeline with 1 consumer processes messages one at a time.

When you deploy a pipeline, you set the number of concurrent executions. The maximum depends on the pipeline size.

## **Replicas**

Replicas are copies of the pipeline running at the same time. They are the way to scale a pipeline horizontally. For example, a Small pipeline with 2 replicas has twice the processing capacity of a Small pipeline with 1 replica.

Replicas also increase availability: if one replica fails, the others keep processing messages.

If your realm uses the Consumption-Based Model, the Platform can adjust the number of replicas automatically. See [Autoscaling](https://docs.digibee.com/documentation/development-cycle/overview/autoscaling.md).

{% hint style="info" %}
A Large pipeline has the same resources as 4 Small pipelines, but they are not equivalent for all workloads. Workloads that process large messages usually need more memory per replica, so choose Medium or Large for them.
{% endhint %}

## **Message processing and redelivery**

Each consumer processes one message at a time. While a message is being processed, it is marked as in use, and no other replica processes it.

If the pipeline crashes or restarts, the message returns to the queue and can be processed again by any replica. The **Allow Redeliveries** option on the trigger defines what happens:

* **Enabled:** The message is processed again.
* **Disabled:** The message is identified as a retry and rejected with an error.

Messages can be redelivered until the trigger timeout (synchronous triggers) or the expiration time (asynchronous triggers) is reached.

To check whether a message is being reprocessed, use the following [Double Braces](https://docs.digibee.com/documentation/connectors-and-triggers/double-braces/overview.md) expression:

```
{{ metadata.execution.redelivery }}
```

## **Timeout and expiration**

Triggers have two time limits:

* **Timeout:** The maximum time the trigger waits for the pipeline response. Set it in milliseconds in the **Maximum Timeout** field of the trigger. Set it higher than the sum of the timeouts of all external connectors so the pipeline has time to handle errors. See the [tips for setting timeout values](https://docs.digibee.com/documentation/resources/best-practices/best-practices-for-error-handling-in-pipelines.md#tips-for-setting-timeout-values).
* **Expiration:** The maximum time a message can wait in the queue. It applies to asynchronous triggers, such as the [Event Trigger](https://docs.digibee.com/documentation/connectors-and-triggers/triggers/messaging-and-events/event.md). Synchronous triggers, such as the [REST Trigger](https://docs.digibee.com/documentation/connectors-and-triggers/triggers/web-protocols/rest.md), use a fixed internal expiration to prevent message loss, so you can't configure it.

The timeout is the same in the test and production environments. It can differ only between pipeline versions.

## **Engine versions**

The engine version runs your pipeline. When you deploy, the latest version is selected by default. The Run page shows the engine version of each deployment below its status, and you can filter deployments by engine version.

## **Next steps**

Now that you understand how execution works, read [Deploy and manage pipelines](https://docs.digibee.com/documentation/development-cycle/overview/deploy-and-manage-pipelines.md) to apply these settings to a deployment.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digibee.com/documentation/development-cycle/overview/how-pipeline-execution-works.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
