Migrate deprecated API usage

When libraries or internal APIs deprecate endpoints, updating every call site is tedious. This automation finds all deprecated usage across your codebase, migrates to the new API, runs tests, and opens a PR.

How to use this template

  1. 1Click "Use this template" or create a new automation in Ona
  2. 2Set your trigger (manual, scheduled, or event-based)
  3. 3Copy each step below into the automation builder
  4. 4Customize the prompts for your specific use case

What this does

  • Automatically detect deprecated API calls
  • Migrate to recommended replacements
  • Validate migrations with tests
  • Open PRs with migration details

Workflow

Trigger

Manual trigger

Select the repository and specify the deprecated API to migrate from and to.

Prompt

Find deprecated usage

Search the entire repository for all usages of the deprecated API: imports, function calls, type references, and configuration.

Prompt

Plan migration

Determine the correct replacement for each usage. Handle changed signatures, renamed parameters, and different return types.

Prompt

Apply migration

Update imports, replace function calls, adjust types, and update configuration files across all affected files.

Shell Script

Run tests

npm test || go test ./... || yarn test || echo "Tests completed"
Pull Request

Open PR

Submit a pull request with the migrated code and migration details.

More automations to explore.

Ready to try a template?

Start building with a free Ona account.

Copied to clipboard!

This website uses cookies to enhance the user experience. Read our cookie policy for more info.