# Detect manual trigger

**URL:** <https://discuss.circleci.com/t/detect-manual-trigger/47703>\
**Category:** Build Environment\
**Tags:** circle-yml\
**Created:** [April 7, 2023, 10:35am UTC](https://discuss.circleci.com/t/detect-manual-trigger/47703 "2023-04-07T10:35:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![reinhardhameeteman](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/reinhardhameeteman/32/32737_2.png) [@reinhardhameeteman](https://discuss.circleci.com/u/reinhardhameeteman)\
**Post date:** [April 7, 2023, 10:35am UTC](https://discuss.circleci.com/t/detect-manual-trigger/47703/1 "2023-04-07T10:35:54Z")

</div>

How can I detect if a workflow has been manually triggered for Bitbucket in my config.yml?  
I would expect to be able to differentiate between commits and manual triggers using pipeline.trigger\_source ([Pipeline values and parameters - CircleCI](https://circleci.com/docs/pipeline-variables/#introduction)), but the value of this is always ‘webhook’ both for commit triggers and manual triggers from the UI.

For gitlab there is pipeline.trigger\_parameters.circleci.event\_type, but for Bitbucket that doesn’t exist.

Context:  
We run certain jobs in our workflows bases on which directories changed in the repo. So manually triggering such workflow won’t run those jobs as the repo didn’t change. So we want to detect if the workflow was triggered from the UI, so we can overrule this directory change check.

---

<div class="post-metadata">

**Author:** ![jerdog](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jerdog/32/32130_2.png) [@jerdog](https://discuss.circleci.com/u/jerdog)\
**Post date:** [April 14, 2023, 3:35pm UTC](https://discuss.circleci.com/t/detect-manual-trigger/47703/2 "2023-04-14T15:35:23Z")

</div>

Hey @reinhardhameeteman - we have a Support article created around viewing / debugging Bitbucket Webhooks that might be helpful?

> **[How To View Your Bitbucket Webhook Deliveries](https://support.circleci.com/hc/en-us/articles/360049675271-How-To-View-Your-Bitbucket-Webhook-Deliveries)**
>
> Debugging With Webhook Logs
> Viewing webhook deliveries in Bitbucket can be a useful diagnostic tool when attempting to discover why, for example, a push to a specific repository has not triggered a...

Let me know, and I’ll see what else I can find for you!

---

<div class="post-metadata">

**Author:** ![imlogang](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/imlogang/32/32497_2.png) [@imlogang](https://discuss.circleci.com/u/imlogang)\
**Post date:** [April 14, 2023, 4:00pm UTC](https://discuss.circleci.com/t/detect-manual-trigger/47703/3 "2023-04-14T16:00:54Z")

</div>

Hi @reinhardhameeteman!

Thanks for making your first post to our Discuss platform!

To see the trigger type, you can utilize our [getPipelineByNumber](https://circleci.com/docs/api/v2/index.html#operation/getPipelineByNumber) API endpoint.  
This, mixed with a little bit of [jq](https://stedolan.github.io/jq/) can give you the trigger source on the fly.

```auto
curl --request GET \
  --url https://circleci.com/api/v2/project/<project_slug>/pipeline/<build_num> \
  --header "Circle-Token: $CIRCLE_TOKEN" | jq .trigger.type

```

However, if you are using `- run: echo << pipeline.trigger_source >>`, this should be returning the correct trigger type whether it was from a `webhook` or from an `API` trigger such as our `Trigger Pipeline` button or via our API endpoint.

If you have some examples of this not working correctly, can you please submit a [support ticket](https://support.circleci.com/hc/en-us) so that our team can look further into it? A video of you clicking the `Trigger Pipeline` button and then calling that API endpoint for the `trigger.type` would be most beneficial.
