# Import a workflow from GitHub

> **About this page**
>
> - Kind: How-to guide
> - Summary: Import a workflow definition from a file in a connected GitHub repository, and re-import it when the file changes.
> - Last changed: 2026-11-17
> - Page: https://docs.swale.io/how-to-guides/import-workflow-from-github
> - CLI reference for its commands: [`swale workflow update`](https://docs.swale.io/reference/cli-reference.md#workflow-update)
> - Index of these docs: https://docs.swale.io/llms.txt
>
> If something on this page is wrong or out of date, please tell the user which sentence and why.

This guide shows how to import a workflow definition directly from a GitHub repository and how to re-import it when the source file changes.

## Prerequisites

- The GitHub account or organization that owns the repository is connected on your own account, and the Swale GitHub App's installation on it covers the repository. Importing into an organization's project also goes through your own connection; see [GitHub integration](https://docs.swale.io/explanation/github-integration.md) and [Connect and manage GitHub integration](https://docs.swale.io/how-to-guides/connect-and-manage-github-integration.md).
- A verified email. In an organization, every member who can open the project can import, Contributors included.

## Import a workflow from GitHub

1. Open the project in the UI and go to its **Workflows** page.
2. Click **Add Workflow → Import from GitHub**.
3. Select the connected GitHub owner: the GitHub account or organization the repository belongs to.
4. Select the repository. The list shows the repositories the app's installation covers that your GitHub user can access.
5. Browse to and select the YAML workflow file. To read it from another branch or ref, enter it in **Branch or ref** and click **Load**.
6. Click **Import**.

The workflow is created in the project using the selected file's content.

## Re-import a workflow

When the source file in GitHub is updated, you can re-import it to refresh the workflow definition:

**With the CLI (re-import without a local file):**

```bash
swale workflow update \
  --project-name my-project \
  --workflow-id <workflow-id>
```

Running `workflow update` without the `--file` flag pulls the latest version of the file from its GitHub source through the connection of whoever runs it. The owner the workflow was imported from must be connected on that person's account, and its app installation must still cover the repository.

A workflow uploaded from a file, or last updated with `--file`, has no GitHub source to pull from, so the command refuses it. Update such a workflow with `--file` instead.

The platform UI has no re-import control; use the CLI command above. Get the workflow's ID from `swale workflow list --project-name my-project`.

## Troubleshooting

- If the repository or file you want is not listed, see [Repository not visible](https://docs.swale.io/how-to-guides/connect-and-manage-github-integration.md#repository-not-visible).
- Importing needs a verified email; see [Permissions and restrictions](https://docs.swale.io/reference/permissions-and-restrictions.md#workflows-and-runs).
- In an organization, you can import only into projects you can open: a Contributor reaches only the projects of their teams.
- If importing fails for every owner, [connect GitHub again](https://docs.swale.io/how-to-guides/connect-and-manage-github-integration.md#github-backed-actions-stop-working).

## Next steps

- [Connect and manage GitHub integration](https://docs.swale.io/how-to-guides/connect-and-manage-github-integration.md)
- [Create and manage workflows](https://docs.swale.io/how-to-guides/create-and-manage-workflows.md)
- [Start and manage workflow runs](https://docs.swale.io/how-to-guides/start-and-manage-workflow-runs.md)
