Migrate legacy Flow extensions
If you have existing Flow extensions that were created through the Partner Dashboard, then you can import these extensions into your codebase. After you deploy the extensions that you’ve imported into Shopify CLI, Shopify CLI manages those extensions going forward.
Extensions that are migrated to Shopify CLI use the handle properties. The handle property is a unique string that identifies your extension and that's used when interacting with the Shopify Flow API. For more information, refer to the triggers and actions runtime payloads.
A handle property is created in the extension's TOML configuration file after running the import command. Note that you can't change the handle property of the extensions that are present in your app's codebase after you've run the dev or deploy commands.
Anchor to RequirementsRequirements
- Be a user with app development permissions.
- Scaffold an app that uses the latest Shopify CLI, or update to the latest version of Shopify CLI.
- Migrate a Dashboard-managed app.
Anchor to Step 1: Import your Flow task extension locallyStep 1: Import your Flow task extension locally
The command in this procedure only generates the local file representation of your Partner Dashboard created extensions. Running the deploy command migrates your extensions to CLI managed-extensions. You can only import extensions that have versions. The published version is imported, if one exists. Otherwise, the latest version is imported.
The command in this procedure only generates the local file representation of your Partner Dashboard created extensions. Running the deploy command migrates your extensions to CLI managed-extensions. You can only import extensions that have versions. The published version is imported, if one exists. Otherwise, the latest version is imported.
-
Navigate to your app directory.
-
To start importing your Flow extension, run the following command:
#!/bin/bashshopify app import-extensions -
Select the
Flow Extensionsoption. -
Select an extension from the list of extensions that are available to import.
After you’ve selected the extension to import, Shopify CLI automatically generates the file representation in your application’s /extensions directory and displays a success message.
You can then go into your application’s /extensions directory and start editing your extension. The file structure of your extension should look like the following:
To learn more about the extensions file structure, refer to App structure and the documentation for your extension type.
Anchor to Available FlagsAvailable Flags
Anchor to [object Object]client_id
client_idAn application’s client_id. The ID enables you to target a specific application when running the import command.
Terminal
Anchor to Step 2: Migrate your extensionStep 2: Migrate your extension
After you've imported the extension, you can migrate your extension by using Shopify CLI's deploy command.
Deploying extensions using the app deploy command also publishes the extensions. We recommend testing changes by using app dev or deploying to a test app before deploying them to a production app.
Deploying extensions using the app deploy command also publishes the extensions. We recommend testing changes by using app dev or deploying to a test app before deploying them to a production app.
Use Shopify CLI to deploy your extensions:
-
Navigate to your app directory.
-
Run the following command to deploy your extension(s):
Terminal
shopify app deploy -
Follow the prompts.
When you receive confirmation that the deploy was successful, your extensions have been released.