# Running Jobs

We'll asume you have created a Job already, if you want to know how to create a new Job please read [this](/devsecops/creating-jobs.md).

There are diverse ways you can use for running Jobs and we're going to cover each in this section.

### Webhook calls

Every Job has a webhook id that can be used for easily triggering the Job from anywhere, this webhook call information can be obtained directly from the Job by clicking the button "CICD Integration":<br>

<figure><img src="/files/vVBV7ADB1vFNDrrOkXxD" alt=""><figcaption></figcaption></figure>

This will open a window where you can copy the command used for triggering the Job

<figure><img src="/files/DodHNYyAkUDPFVSlVf2r" alt=""><figcaption></figcaption></figure>

Let's see several ways for calling the webhook:

#### CURL command

OSX and Linux:

```sh
curl -H "X-API-KEY: <API_KEY>" https://app.zirkul.com/api/webhook/<id>
```

Windows:

```sh
curl -H @{'X-API-KEY'='<API_KEY>'} https://app.zirkul.com/api/webhook/<id>
```

If you want to send variables in your request, use the custom http request header `ZIRKUL-VARIABLES` as follows.

```sh
curl -H "X-API-KEY: <API_KEY>" -H "ZIRKUL-VARIABLES: my_var='the value' " https://app.zirkul.com/api/webhook/<id>
```

#### Zirkul Agent CLI

The Agent can be executed as a CLI interactive tool and there are some parameters that allows you to call a webhook with some extended functionalities.

This is a simple command for calling a webhook and wait until the job is completed:

```sh
zirkul --agent cicd --server https://app.zirkul.com --webhook <WEBHOOK_ID> --apikey '<API_KEY>' --wait
```

You can also send custom variables to the Job with the [variables option.](/zirkul-agent/running-the-agent/command-line-interface.md#external-variables)

The output would be something like this:

<figure><img src="/files/jmTxqhwC54ijmqNJzO5p" alt=""><figcaption></figcaption></figure>

Use the option `--wait` if you want the Agent to wait until the Job is completed, otherwise the command will exit as soon as the webhook call is completed.

See more about [webhook calls here](#webhook-calls).

#### PowerShell

```powershell

$headers = @{
    'X-API-KEY' = '<API_KEY>'
}
Invoke-RestMethod -Uri https://app.zirkul.com/api/webhook/<id> -Method Get -Headers $headers

```

### Securing your secrets

It's strongly recommended to store your API Keys in variables instead of hardcoding the values in your pipelines to prevent unauthorized access to secrets.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zirkul.com/devsecops/running-jobs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
