Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A webhook is a custom callback over HTTP used to setup communication between applications. They provide a way to automatically notify other applications when an event has occurred in your application in the form of an HTTP post payload. This eliminates the need to poll your application to check for new events – the application will alert you when there's something new! Webhooks in FlexDeploy can be used to trigger actions in FlexDeploy based on events happening in other applications, thus eliminating some manual actions. For example, you can setup a webhook to build a project immediately after a push occurs in your SCM. This is just one example, and FlexDeploy's model offers flexibility in what you can accomplish with webhooks.

Info
titleGetting Started

Checkout this Getting Started guide after you read this page.

Incoming Webhook Flow

There are two key aspects to webhooks in FlexDeploy; Providers and Functions. The flow diagram below illustrates how these different pieces interact with each other for a given webhook message:

Drawio
simple0
zoom1
inComment0
custContentId1749188751
pageId1683521582
diagramDisplayNamewebhook_flow.drawio
lbox1
contentVer12
revision12
baseUrlhttps://flexagon.atlassian.net/wiki
diagramNamewebhook_flow.drawio
width611
links
tbstyle
height631

...

2. After a Provider has matched, FlexDeploy will find all available Functions for that Provider that match the received URI. In this case the URI was git/push. We can see that of our 6 functions, 2 matched our GitHub provider with the git/push uri. These functions Notice the "Jira - git/push" and "GitHub - stream/create" Functions did not match because both Provider and URI need to match.

The matched Functions will be executed in an indeterminate order. If you need functions Functions to execute in a specific order then it is recommended to combine the functionality into a single Function script.

...

Info
titleFunction URIs

The URIs after the base '/flexdeploy/webhooks/v1' uri are purely by convention and any uri can be used. In this example we had "git/push" but "something/random" would have worked exactly the same. The benefit of this approach is that you can direct 90% of your Git Repositories to a standard 'git/push' function while maybe the remaining 10% have more complex logic and need to be directed to a separate "git/complex" function.

Also note that Query Parameters query parameters can be passed and accessed from the scripts but is are not included in the URI matching. I.E. git/push?projectId=123 will still match to git/push.

Navigation

Webhooks can be accessed from Administration → Integrations → Webhooks→ Incoming Webhooks. This page will show all the Webhook Functions configured in FlexDeploy.  Webhook Providers can be accessed from the  button on the functions page. Click  to view the results of any received webhooks, or to resubmit them.


See more details about each webhook topic below:

...