# 1.4 Setting up Callbacks for Integration activation/deactivation

## Use Cases

There are multiple use cases for setting up callbacks in Embed Flows:

* Registering/removing webhooks to trigger the Flow via webhook
* Receiving the activation state for specific Flows and users

#### Summary in 4 minutes:

{% embed url="<https://www.youtube.com/watch?v=kkbZ_kOYV9o>" %}
Callbacks and redirect\_urls for White Label Embed - Embedded iPaaS
{% endembed %}

## Setup

{% hint style="info" %}
As a prerequisite, you need to have your own Connector and edit access to it. In case you do not have either of them, please reach out to us.
{% endhint %}

1. Create a Flow that should be triggered whenever an Integration is activated and (optionally) a Flow that is triggered whenever an Integration is deactivated ("lifecycle Flows")
   1. These Flows send requests to your own Connector with callback parameters:
      1. [Example activation Flow](https://app.locoia.com/community-library?page=1\&perPage=10\&nameSearchString=White%20Label%20Embed%20Creation%20Callback%20Template%20Flow\&sortProp=reference\&sortOrder=ascending)
      2. [Example deactivation Flow](https://app.locoia.com/community-library?page=1\&perPage=10\&nameSearchString=White%20Label%20Embed%20Deletion%20Callback%20Templat\&sortProp=reference\&sortOrder=ascending)
      3. *Note*: The [JWT payload](https://docs.locoia.com/embed-white-label-portal/embed-admin-setup/flow-building/pages/-MdTSrokY-822qYwl9qO#1.-passing-data-to-locoia) is available in these Flows and, when using the same Connector as in the Embed Flow, Authentication can be used from the Embed Flow by specifying `{{ connectorAuth }}` in the **Dynamic Authentication ID** field
2. [Create an Action](/connectors/building-connectors/building-connector-actions.md) for your Connector that is ideally called `triggered_by_embed`
   1. This action has the purpose of triggering the lifecycle flows and thus no method or endpoint needs to be specified
   2. Add the Flows you created to the **Pre Save Flow** and **On Delete Flow** fields respectively
   3. The action ideally has a password (first step of the created Flows in step #1) in order to prevent it from being used otherwise, thus the **UI Form Schema** field should be:

```json
{
  "password": {
    "type": "password",
    "title": "Password for White Label Embed Creation Callback Flow",
    "required": true
  }
}
```

<figure><img src="/files/WEjrFtjudfS0NJUKXpFM" alt="" width="563"><figcaption><p>Enter <strong>Pre Save Flow</strong> and <strong>On Delete Flow</strong> into the fields</p></figcaption></figure>

3\. Use the created Action at the beginning of your Embed Flows. This way, every time one of your users activates or deactivates an Embed Flow, the lifecycle Flows will be triggered.


---

# 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://docs.locoia.com/embed-white-label-portal/embed-admin-setup/flow-building/1.4-setting-up-callbacks-for-embed-activation-deactivation.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.
