# Workflow Run Action

This action is responsible for triggering the execution of a workflow in your workspace. This way, you can automate the execution of your workflows within existing CI pipelines.

## Authentication

To authenticate with Chassy API you need to supply an authentication token. Please consult our documentation on how to [Generate Chassy Tokens](/operator-guides/generate-chassy-tokens.md). The GitHub action consumes this value from an environment variable called `CHASSY_TOKEN`. Ideally, this secret information is stored within a GitHub action secret (see [GitHub Documentation](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions)) and can then be referenced within your workflows as follows:

```yaml
env:
    CHASSY_TOKEN: ${{ secrets.CHASSY_TOKEN }}
```

With this token provided, you can continue with configuration.

## Configuration

There are three configuration options for this workflow. Only `workflowId` is required. These configurations are all to be made within the `with` block in your actions YAML file.

### Workflow ID

The provided `workflowId` specifies which workflow you wish to run. It is required for the action to function.

### Sync

The optional `sync` boolean parameter (defaults to `true`) allows you to decide whether you want the action to await the completion of your workflow's execution before the action is complete. Turning this off will mean that your workflow isn't checked for successful execution.

### Parameters

The optional `parameters` parameter is a JSON-encoded catch-all for any user-defined data for workflow execution.

## Example

In the example below, our workflow will be executed synchronously with no custom parameters. Afterward, the results will be printed to standard out.

```yaml
example-action:
  name: Example Action
  runs-on: ubuntu-latest
  env:
    CHASSY_TOKEN: <my token>
  steps:
    - name: Run a workflow
      id: workflow-run
      uses: chassyflow/actions-workflow-run@v1.2.0
      with:
        workflowId: '<some workflow id>'
    - name: Print Workflow Output
      id: output
      run: echo "${{ steps.workflow-run.outputs.workflowexecution }}"
```

### Source

The source code for this action can be found in the [official GitHub repository](https://github.com/chassyflow/actions-package-upload).


---

# 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.chassy.io/operator-guides/integrating-with-github/workflow-run-action.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.
