Trigger Workflows Using Webhooks
This guide demonstrates how to trigger workflows using webhooks.
Creating a Workflow
To create a workflow follow the following steps:
- Navigate to the Workflows Section on the dashboard.
![Navigate to Workflow Section](/img/workflows/trigger-using-webhook/workflow-section.png)
- Click on Create new workflow, enter a unique name for your workflow and click on + Create workflow to create the workflow.
![Create a new workflow](/img/workflows/trigger-using-webhook/new-wf.png)
- Configure your workflow. You can refer to the workflow overview documentation to learn how you can configure a workflow.
![Configure workflow](/img/workflows/trigger-using-webhook/configure-wf.png)
- Navigate to the Triggers section.
![Webhook option on the left panel](/img/workflows/trigger-using-webhook/trigger-section.png)
- Click on Webhooks. By default, the webhook trigger is disabled. Toggle the switch to enable the webhook trigger. Refer to the trigger documentation for more information.
![Enable Webhook](/img/workflows/trigger-using-webhook/enable-webhook.png)
- Add Parameters to the workflow by clicking the + Add parameter button.
![Add parameters to your webhook](/img/workflows/trigger-using-webhook/parameters.png)
- Copy the Endpoint URL and API token.
![Copy URL and API Token](/img/workflows/trigger-using-webhook/copy-url.png)
Triggering a Webhook
Let's take a look at an example of triggering a webhook using Postman.
- Visit Postman, and click New Request.
![Postman preview](/img/workflows/trigger-using-webhook/postman.png)
- Select the POST Method and paste the Endpoint URL that was copied earlier.
![Paste URL in Postman](/img/workflows/trigger-using-webhook/postman-url.png)
- Navigate to the Authorization tab, select Bearer Token as the Auth Type, and enter the API token.
![Enter the API Token](/img/workflows/trigger-using-webhook/api-token.png)
- Go to the Body tab, select Raw, and enter the required parameters in JSON format.
![Enter the parameters in postman](/img/workflows/trigger-using-webhook/parameters-postman.png)
- Click on Send to trigger the webhook. It will fetch the response from the created workflow.
![Final Response](/img/workflows/trigger-using-webhook/response.png)
This was a basic example of how you can trigger workflows using webhooks. You can use webhooks to connect ToolJet to external applications and services for advanced use-cases and event-driven automation.
If you want to learn how to trigger workflows withing ToolJet, refer to this guide.