# Dynamic API Workflows

Dynamic API workflow is a custom Chat Flow channel. It gets triggered by an incoming payload and lets you initiate engagement with your customers by, for example, sending a pre-approved WhatsApp template (using the [Send Template](https://guides.clickatell.com/flow/action-nodes/send-template) node), or a rich link node, prompting them to act and trigger a standard workflow.&#x20;

Note that a Dynamic API workflow has no access to user facing nodes because it is an API builder.

**How to set up a Dynamic API Workflow:**&#x20;

**Build the workflow**&#x20;

1. Select Dynamic API flow under Flows from the menu on the left. A *Start* node and arrow will automatically appear on your canvas as the starting point for your flow.&#x20;

<figure><img src="https://3262477137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjoAgInTNsBfDdfx1I23z%2Fuploads%2FJC9PSnTEdRrWlygaIzp5%2Fimage.png?alt=media&#x26;token=b1260f5c-514c-4ecc-ac9a-703bbeca90c0" alt=""><figcaption></figcaption></figure>

2. Build out your workflow. You can select from different Action nodes from the panel on the right onto the dotted placeholder node. You can also click on the + in the placeholder node to bring up a node menu.&#x20;
3. Select a [node ](https://guides.clickatell.com/flow/workflow-management/create-new-flow#nodes-the-building-blocks-of-your-workflow)on the canvas to configure/edit it in a panel on the right.&#x20;
4. Repeat this process as required to build out your workflow. Remember to save your changes to each node.&#x20;
5. There is a special end node to end the flow session. When you are at the end of your workflow, add the API end node.&#x20;

Note that there is no flow preview for Dynamic API workflow. You can use an API test tool to preview/test your Dynamic API workflow.&#x20;

**Set up the routing**

{% hint style="info" %}
Before a route for a Dynamic API can be added it needs to be onboarded for the entity. To activate a Dynamic API channel, you will need to [log a ticket](https://www.clickatell.com/contact-support/) with our Support team.&#x20;

Once the Dynamic API channel is added to the entity a new channel tab will appear under Chat Flow Routing.&#x20;
{% endhint %}

<figure><img src="https://content.gitbook.com/content/joAgInTNsBfDdfx1I23z/blobs/cdrBkivIWTw3jfPNJuBY/image.png" alt=""><figcaption></figcaption></figure>

1. Select Routing from the panel on the left. &#x20;
2. Configure the relevant fields. You are presented with several options to customize the endpoint.&#x20;
   1. HTTP METHOD - Chat Flow supports the following methods:

* GET
* POST
* DELETE
* PUT

&#x20;           b.  Allowed I.P Address Sources - This is a ';' delimited list of IP addresses that should be allowed to call your Dynamic API, e.g. 10.0.0.1;10.0.0.2.

* If you want to allow any IP address access you can use 0.0.0.0/0 for IPv4 and ::/0 for IPv6 e.g. 0.0.0.0/0;::/0 to match any IPv4 and IPv6 address.

&#x20;            c.  Asynchronous toggle.

* This is set to Synchronous by default. To add an asynchronous route/request, enable the toggle. Note that for asynchronous requests there is no feedback on the response, only acknowledgement that the request was received and processed.&#x20;

4. Select a flow and step. Save the route.&#x20;
5. Once the route is saved, Chat Flow will generate a unique URL for your route. A unique API token will also be generated.&#x20;

&#x20;

<figure><img src="https://content.gitbook.com/content/joAgInTNsBfDdfx1I23z/blobs/967dSPndC6ceFLDzjfqb/image.png" alt=""><figcaption></figcaption></figure>

2.

&#x20;&#x20;
