# Migrate to Speakeasy workflows
Source: https://speakeasy.com/docs/sdks/manage/migrate/workflow-migration

The [`workflow.yaml` file](/docs/speakeasy-reference/workflow-file) allows defining all the relevant pieces of SDK generation as consistent configs in a single place.
This new generation system is entirely portable. Generate SDKs locally, from GitHub, or from any CI system with absolute consistency.

## Who needs to migrate?

Customers who started with Speakeasy in March 2024 or later are likely already using Speakeasy workflows. Verify this by checking the folders in the generated SDK. If the SDK contains a `.speakeasy` folder, it is already using workflows.

If you started using Speakeasy before March 2024, follow the steps below to migrate to workflows.

## Migration steps

For existing Speakeasy SDKs in GitHub, an easy migration tool is available. Navigate to the root of the repo and run the following command:

```bash
speakeasy migrate
```

The following changes will appear as a result:

- `.speakeasy/workflow.yaml` [NEW]
- `.github/workflows/sdk_generation_action.yaml` [UPDATED]

Push these changes up and you are ready to go!

The produced files should look something like the following:

```yaml filename=".github/workflows/sdk_generation_action.yaml"
name: Generate
permissions:
  checks: write
  contents: write
  pull-requests: write
  statuses: write
"on":
  workflow_dispatch:
    inputs:
      force:
        description: Force generation of SDKs
        type: boolean
        default: false
  schedule:
    - cron: 0 0 * * *
jobs:
  generate:
    uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
    with:
      force: ${{ github.event.inputs.force }}
      mode: pr
    secrets:
      github_access_token: ${{ secrets.GITHUB_TOKEN }}
      speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
```

```yaml filename=".speakeasy/workflow.yaml"
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
    openapi:
        inputs:
            - location: https://raw.githubusercontent.com/speakeasy-sdks/template-speakeasy-bar/main/openapi.yaml
targets:
    my-target:
        target: typescript
        source: openapi
```

It is now possible to generate the SDK locally using `speakeasy run`, while GitHub Actions automated generations will continue working as before.

Any custom code in the current GitHub Actions workflow should automatically be moved over by the migration script.

If you have any issues migrating to workflows, reach out to the Speakeasy team on Slack and we will help you resolve it quickly.

## Creating a new SDK repo

To migrate by creating a new SDK repo, an easy-to-use command is available for setting up an SDK for the preferred specification and language.

Create a new repo and run the following commands from the root directory:

```bash
speakeasy quickstart
speakeasy configure github
```

After creating the repo, copy the `gen.yaml` from the old SDK into `.speakeasy/gen.yaml` in the new SDK repo. The SDK is now ready to generate!