# Transactions

[Link](https://docs.camunda.org/manual/7.21/user-guide/process-engine/transactions-in-processes/)

### Understand Asynchronous Continuations

To understand how asynchronous continuations work, we first need to understand how an activity is executed:

<figure><img src="https://docs.camunda.org/manual/7.21/user-guide/process-engine/img/process-engine-activity-execution.png" alt=""><figcaption></figcaption></figure>

The above illustration shows how a regular activity which is entered and left by a sequence flow is executed:

1. The “TAKE” listeners are invoked on the sequence flow entering the activity.
2. The “START” listeners are invoked on the activity itself.
3. The behavior of the activity is executed: the actual behavior depends on the type of the activity: in case of a `Service Task` the behavior consists of invoking [Delegation Code](https://docs.camunda.org/manual/7.21/user-guide/process-engine/delegation-code/), in case of a `User Task`, the behavior consists of creating a `Task` instance in the task list etc…
4. The “END” listeners are invoked on the activity.
5. The “TAKE” listeners of the outgoing sequence flow are invoked.

Asynchronous Continuations allow putting break points between the execution of the sequence flows and the execution of the activity:

<figure><img src="https://docs.camunda.org/manual/7.21/user-guide/process-engine/img/process-engine-async.png" alt=""><figcaption></figcaption></figure>

The above illustration shows where the different types of asynchronous continuations break the execution flow:

* An asynchronous continuation BEFORE an activity breaks the execution flow between the invocation of the incoming sequence flow’s TAKE listeners and the execution of the activity’s START listeners.
* An asynchronous continuation AFTER an activity breaks the execution flow between the invocation of the activity’s END listeners and the outgoing sequence flow’s TAKE listeners.

Asynchronous continuations directly relate to transaction boundaries: putting an asynchronous continuation before or after an activity creates a transaction boundary before or after the activity:

<figure><img src="https://docs.camunda.org/manual/7.21/user-guide/process-engine/img/process-engine-async-transactions.png" alt=""><figcaption></figcaption></figure>

What’s more, asynchronous continuations are always executed by the [Job Executor](https://docs.camunda.org/manual/7.21/user-guide/process-engine/the-job-executor/).

<br>


---

# Agent Instructions: 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://amartyushov.gitbook.io/tech/platforms/camunda/transactions.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.
