---
title: "webhook trigger action"
canonical: "https://support.appfire.com/space/CDMC/1833795862/webhook%20trigger%20action"
format: markdown
---
> Macro (toc)

## webhook trigger action

You might need to fire a webhook to an external URL in certain situations. The **Webhook** trigger action lets you send a simple webhook request to a specified external URL. You must provide the destination URL and, if necessary, include details of the notification in the webhook action's payload. 

![cdmc_visualeditor_add_webhookaction_allparametervaluesadded.png](media://31ccc9b3-e3f7-4a94-a368-0d315e23c29e)

You can use value references, such as `${content.id}` in the destination URL's value. The webhook payload accepts JSON and can also include value references.

> ℹ️ There is no on-screen confirmation of the webhook action. However, the webhook action is recorded in the log. The log entry renders the values of any value references used in the value for the **URL** or the **Payload**.

## Webhook action parameters

| **Action Parameter** | **Value** | **Notes** |
| --- | --- | --- |
| **Name** | String value for the name of the webhook<br>- can be empty | Optional. |
| **URL **[MANDATORY] | The destination webhook in a valid URL format:<br>- POST method
- accepts value references* | The URL is validated, and if it is not in a valid format the webhook does not fire. |
| **Payload** | String value for payload<br>- text string
- accepts value references, JSON, and XML
- can be empty | Optional.<br>Supported value references:<br>- `${content.id}` -  content id
- `${content.title}` - content title
- `${content.link}` - content link
- `${content.siteName}` - site name
- `${content.space}` - space name |

When the workflow [Event](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2193950329) occurs, the trigger checks that any required [Conditions](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2193852785) are met, and if they are, the **Webhook** action sends a message using the POST method to the specified external destination.

> 📝 Only one webhook action can be added to a trigger event. Each additional webhook action must be added to a separate trigger event.

## Webhook JSON code

A **Webhook **workflow trigger action added using the [visual editor](https://appfire.atlassian.net/wiki/pages/createpage.action?spaceKey=cdmc&title=Workflow%20builder%20visual%20editor&linkCreation=true&fromPageId=1833795862) is automatically displayed as a `“webhook”` trigger action code editor.

![cdmc_codeeditor_workflowtrigger_webhook_action_onchangestateevent.png](media://260b825f-c745-4e71-8bfe-1b24497afafd)

You can also use the code editor to add the workflow trigger and the `“webhook”` action.

<details>
<summary>"webhook" parameters and workflow code example</summary>

> Macro (toc)

### `"webhook"`

The trigger action `"webhook"` sends a webhook request to an external URL.

- **action (*****webhook*****) **
  - **name ** name of the webhook (optional). *Add value to reflect the context of the webhook*
    - text string
  - **url ** **❗️** the destination webhook
    - POST method
    - accepts value references*
  - **payload** payload of the webhook  (optional)
    - text string
    - accepts value references*, JSON and XML
    - can be empty

---

### ❗️ Mandatory parameters

**url**

The value of the destination URL must be added. It can be added as a value reference

> ℹ️ The **url** value is validated in a valid URL format.

---

### Trigger example

```
"triggers": [
    { "event": "on-change-state",
          "conditions": [{ "state": "Accepted" }],
          "actions": [
            { "action": "webhook", 
               "name" : "acceptance_webhook"
               "url": "https://www.example.com}",
               "payload" : "{'name': 'Moises', contentId: ${content.id}}"
             }
          ]
    }
    ]
```

The above `trigger` listens for a state change event to the **Accepted** state and sends the webhook notification to the destination URL.

---

### Example log

```
{"_logLevel":"info","msg":"Webhook sent successfully!",
"_loggerContext":{"id":"0166a022-a7a5-48e8-b728-d738b08f8731",
"endpoint":"POST: /fireflow/resource/commands","userInstance":
"https://comalamarshall.atlassian.net/wiki",
"appKey":"com.comalatech.workflow.local.dev",
"clientKey":"4a105e56-933d-31b9-90ae-d3e7f1cb60da",
"spaceKey":"PDS","contentId":"256966765","fingerprint":""},
"name":"acceptance_webhook","mappedUrl":"https://comalamars.atalassian.net/post",
"mappedPayload":"{\"name\": \"Moises\", \"contentId\":"186456763" }",
"timestamp":"2025-03-06T10:25:45.154Z","_tags":[]}
```

---
</details>

## * Supported value references

- `${content.id}` -  content id
- `${content.title}` - content title
- `${content.link}` - content link
- `${content.siteName}` - site name
- `${content.space}` - space name

## Related pages

- [Triggers](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2192967825)
- [Trigger events](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2193950329)
- [Trigger conditions](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2193852785)
- [Trigger actions](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2192870598)
- [Add a workflow trigger using the visual editor](https://appfire.atlassian.net/wiki/pages/createpage.action?spaceKey=cdmc&title=Add%20a%20workflow%20trigger%20using%20the%20visual%20editor&linkCreation=true&fromPageId=1833795862)
- [Add a workflow trigger using the code editor](https://appfire.atlassian.net/wiki/pages/createpage.action?spaceKey=cdmc&title=Add%20a%20workflow%20trigger%20using%20the%20code%20editor&linkCreation=true&fromPageId=1833795862)