n8n

Learn how to create workflows using Unipile with n8n.

Make triggers with Webhooks

Let say we want to initiate a workflow when a new email is received.

  1. Set your first step as On webhook call
  2. Set the HTTP Method to POST.
  1. Click on Listen for test event
  2. Now, n8n is waiting for a first event to confirm everything is working. Let's send the event:
    1. Copy the Test URL
    2. In Unipile's Dashboard, Add Endpoint from the Webhooks tab.
    3. Paste the copied value to Endpoint URL.
    4. Select the event(s) that should trigger the Webhook. For this example, select email.new. Then save by hitting Add Endpoint.
    5. Refer to Test & Debug webhooks to send a Test event.
    6. You should now see some output in n8n.
    7. In Unipile's Dashboard, update the endpoint with the Production URL for production usage.
  3. You can now use data from the payload of the webhook in the following steps of your workflow.


Make actions with Methods

  1. Create a node and search for HTTP Request

  2. Select Generic Credential Type in Authentication.

  3. Select Header Auth in Generic Auth Type.

  4. If you don't have one for Unipile, create a new credentials in Header Auth:

    1. Create an API Key in Unipile's dashboard
    2. Copy paste it in Value
    3. Set Name as X-API-KEY
    4. Change Header Auth Credential to Unipile API Key
    5. Save
  1. Find the method you want to use in the API Reference
  2. Set the proper URL and Method. For this example, we'll use Send a Message : set https://api.unipile.com/v2/account_id/chats/chat_id/messages/send as URL and POST as Method. Of course, set account_id and chat_id to your needs. Note that they can be dynamically retrieved from other nodes, refer to the n8n documentation to learn about that.
  1. If you need to pass Query Params, check Send Query Parameters and specify them in the fields below. For exemple the offset of List all Chats :
  1. If you need to pass Body Params, check Send Body and specify them in the fields below. For exemple with Send a message :
  1. Refer to the n8n documentation to handle the result.

Control cache on requests

Unipile support the Cache-Control standard request header and few of its directives to control the Caching when you make a request on Methods API. You can add this header on your request configuration by checking Send Headers