Skip to content

Start a workflow from GitLab events

To run a workflow when GitLab reports a push, a merge request, an issue, or a pipeline, add a Webhook block whose Source is GitLab and give its URL to a webhook in GitLab. GitLab posts one event per request. Each event starts its own run.

You need GitLab 19.0 or later, the Maintainer or Owner role in the project whose events you want, and edit access to the workflow’s project. The GitLab steps happen in GitLab.

Add the Webhook block and generate its URL

Section titled “Add the Webhook block and generate its URL”
  1. In a draft workflow, add a Webhook block. The block palette also lists GitLab webhook in the Start group, which adds the block with its source already set.
  2. Under Source, choose GitLab. The line under the setting reads “Verifies the signature · one run per event · skips duplicates”.
  3. Under Webhook URL, select Generate URL, then copy the URL.

The badge beside the URL reads “Runs start after publish”. The URL contains a token, and anyone who has the URL can send requests to it. Keep it out of shared documents.

  1. In GitLab, open the project, then Settings, then Webhooks, and select Add new webhook. To receive events from every project of a group, open the group’s Settings instead. A group webhook needs the Owner role.
  2. In URL, paste the URL you copied.
  3. Select Generate signing token and copy the token. It starts with whsec_. GitLab displays it only once, so keep the copy until the next section.
  4. In the Trigger section, select the events GitLab sends to this URL.
  5. Select Add webhook.

The Webhook block offers these GitLab event types: Push Hook, Tag Push Hook, Issue Hook, Note Hook, Merge Request Hook, Wiki Page Hook, Pipeline Hook, Job Hook, Deployment Hook, Release Hook, Milestone Hook, and Emoji Hook. A type is the name GitLab sends with each request, which differs from the wording in GitLab’s form: a merge request event arrives as Merge Request Hook.

The GitLab source checks the signing token only. A GitLab older than 19.0 has no signing token. It offers a Secret token, a value you type in the same form and GitLab repeats in each request. For such a GitLab, set Source to Custom and set the signature check under Advanced to A secret value in a header. Webhook settings describes the Custom source.

GitLab signs each request with the webhook’s Signing token. The same value lets OutWin check that signature.

  1. In OutWin, paste the token into Signing token in the block’s settings. Paste all of it, including whsec_.
  2. Select Save.

After you save, the settings show only the last four characters of the token, with Replace and Remove. Under Set up, the second line changes to “The signing token is saved: deliveries are verified.”

GitLab issues the token for one webhook, so OutWin saves it on the block’s URL. It is not saved on a connection. A second Webhook block has its own URL and needs its own GitLab webhook and token.

If you did not copy the token, GitLab does not show it again. Add a new webhook in GitLab, generate its token, save that token in OutWin, and delete the first webhook.

With a token saved, OutWin also checks the time in the signature. A request signed more than five minutes before or after the moment it arrives is listed as Refused.

Without a saved token the block still starts runs, and nothing is verified: anyone who has the URL can start the workflow. Publishing then shows a warning that ends “has no signing secret saved, so its deliveries are not verified: anyone who has this URL can start this workflow”. The warning does not block publishing.

Under Events that start a run, tick the event types that start a run. With none ticked, every event GitLab sends starts a run. To start runs for a type that is not listed, type it into the box under the list and select Add.

An event whose type is not ticked is listed as Filtered out and starts no run. To narrow further by a field of the event, add a row under Only when. Webhook settings lists the comparisons.

  1. In GitLab, find the webhook in the list under Settings, then Webhooks, and choose an event from its Test dropdown. A test of a push event needs at least one commit in the project. You can also cause a real event, such as opening an issue in a test project.
  2. In OutWin, look under Recent deliveries in the block’s settings.

Recent deliveries lists every event that reached the URL, including while the workflow is a draft. On a draft each event is listed as Dropped with “The workflow is not published, so nothing ran.” It starts no run and is not run later. The last line under Set up changes from “Waiting for the first event…” to, for example, “Received Issue Hook. Dropped.”

With a token saved, an event listed as Dropped on a draft has passed the signature check. A delivery that fails the check is listed as Refused.

If you have edit access, select an event to see what the block passed on. The list is kept for seven days, and the data of the newest 20 events is kept.

Each run receives one GitLab event. GitLab puts the event’s type, id, and time in request headers, so read them from event. An HTTP request block or a database block directly after the Webhook block reads the event with these expressions. An AI block such as Think receives the whole value as its input.

Expression What it holds
{{input.body}} The event’s data as GitLab sent it, with an object_kind field such as push, issue, or merge_request. Other fields depend on the event type.
{{input.body.object_kind}} One field of the event. Read any other field the same way.
{{input.event.type}} The event’s type, such as Issue Hook. It is the request’s X-Gitlab-Event header.
{{input.event.id}} The delivery’s id. It is the request’s webhook-id header.
{{input.event.time}} The time GitLab sent the request, as an ISO 8601 date and time. It is the request’s webhook-timestamp header, so a request that GitLab sends again carries a later time.
{{input.delivery.verified}} true only when the signature was checked and passed.

A block further along reads the same values through the Webhook block’s name, as in {{steps["GitLab"].body.object_kind}} for a block named GitLab. Data and context describes what each block passes on.

Publish the workflow. From then on, each event that passes the filter starts a run. On a published workflow the block’s settings are read-only, and Recent deliveries is in the block’s inspector. You can still replace the token there.

Outcome What happened
Ran The event started a run.
Waiting 10 runs of the workflow are already active. The event starts a run when one of them ends. An event that waits longer than an hour is listed as Dropped.
Duplicate A request with the same webhook-id already ran in the last 72 hours, which happens when a delivery is sent again from GitLab. The line reads “This event was already received and run, so it did not run again.”

Runs start in the order events arrive. That is not always the order things happened, so do not build a workflow that relies on Push Hook arriving before Pipeline Hook.

Receiving an event costs no credits, and neither does an event that is filtered out or a duplicate. A run that starts uses credits for the blocks that run in it.

Open Recent deliveries and read the outcome and the sentence beside the newest event.

What you see Cause Fix
“Nothing has arrived yet.” No request has reached the URL. Check that the webhook in GitLab is enabled, that it sends the event you caused, and that its URL is the block’s current URL. Rotate token on a published workflow changes the URL, and the old one stops working.
Dropped with “The workflow is not published, so nothing ran.” The workflow is a draft. Publish the workflow. Events that arrived before then are not run later.
Dropped with “The workflow is paused, so nothing ran.” The workflow is paused. Resume the workflow. Events that arrived while it was paused are not run later.
Filtered out with Events of type "Note Hook" are not chosen on this trigger. The event’s type is not ticked under Events that start a run. Tick the type, or clear every tick so that all events start a run. The settings are read-only on a published workflow.
Refused with “The signature did not match. Check that the secret saved here is the one the sender shows for this URL.” The token saved in OutWin is not the signing token of the webhook that sent the request, for example because it was copied from another webhook. GitLab does not show its copy, so you cannot compare the two. Add a new webhook in GitLab with a new signing token, select Replace in OutWin, and delete the first webhook. You do not republish the workflow.
Refused with “The request carried no signature.” A token is saved in OutWin, and the webhook in GitLab has no signing token, so GitLab sent the request unsigned. A GitLab older than 19.0 sends every request that way. Add a webhook that has a signing token. For an older GitLab, set the source to Custom as described above.
Refused with “The saved secret could not be used as this sender’s key. Save it again exactly as the sender shows it.” The value saved as the token is not a signing token OutWin can read, for example because it was cut short when copied. Save the whole token, including whsec_, with Replace.
Refused with “The request’s timestamp is too far from now, so it may be a replay of an old delivery.” The request was signed more than five minutes before or after it arrived, for example because a saved copy of an earlier request was sent again. Cause a new event in GitLab.

A delivery listed as Refused is answered with status 401 and starts nothing. OutWin keeps none of its data. GitLab counts that answer as a failed delivery and turns off a webhook for a while after four failures in a row, so fix the token before you send more tests. For every other outcome in the table, GitLab receives a success response and OutWin does not run the event later.