Create a workflow template
A template in Shopify Flow is an example workflow that can be copied into a merchant's shop. Templates help merchants automate a specific use case with minimal or no additional configuration. Flow's template library offers hundreds of templates with features to filter, browse, and search. You can create a template for Shopify Flow that showcases your custom triggers and actions and help merchants do more.
To create a workflow template that merchants can add to their workflow list, you need to add a Flow template extension to your app.
Requirements
Anchor link to section titled "Requirements"- A development store that has Shopify Flow and your app installed.
- Your existing custom triggers and actions are connected to your instance of Shopify Flow.
- Shopify CLI installed with a version of
3.49
or higher.
Step 1: Create a workflow
Anchor link to section titled "Step 1: Create a workflow"A workflow is the foundation of a Flow template.
- In your development store navigate to Apps > Flow.
- Click Create workflow.
- In the workflow editor, build a workflow that solves a merchant use case and showcases your custom trigger and or actions.
- Optional: Tailor your template to a wider audience by localizing your custom step descriptions.
- After you're satisfied with your workflow, export the workflow and save the
.flow
file locally.
Step 2: Create a Flow template extension
Anchor link to section titled "Step 2: Create a Flow template extension"Use the Shopify CLI to generate a new extension:
- Navigate to your app directory.
- Run the following command:
- Select the
Flow Template
as the type of extension. - Provide a meaningful name for your extension.
The name that you provide displays in the Partners Dashboard. Follow these guidelines when choosing a name:
- Don't use punctuation.
- Separate words using spaces.
After you've followed the prompts, Shopify CLI generates the extension’s file representation in your app's /extensions
directory and returns a success message. You can then go into your app's /extensions
directory and start editing your new extension.
The file structure of your extension should look like the following:
To learn more about the extensions file structure, refer to our app structure documentation and the documentation for the Flow template extension type.
Step 3: Configure extension
Anchor link to section titled "Step 3: Configure extension"Configure your template extension to include information describing it's function for merchants, and settings that control visibility.
- Update the shopify.extension.toml configuration file.
- Update and add any additional locales. Localization reference.
- Replace
template.flow
with the workflow that you exported. - Be sure to update the filename to match your chosen file path in the
shopify.extension.toml
file.template.flow
is the default.
Step 4: Preview extension
Anchor link to section titled "Step 4: Preview extension"Preview your template extension to see how it will be displayed to merchants before deploying and requesting review.
- Run the following command in Shopify CLI:
- In your development store's Shopify admin, navigate to
/flow/editor/templates/dev
. From here you can preview your workflow, template card, and custom step descriptions. - Refer to our approval criteria to ensure that your extension meets our requirements.
Step 5: Deploy extension
Anchor link to section titled "Step 5: Deploy extension"Use Shopify CLI to deploy your extension.
- Navigate to your app directory.
- Run the following command to start deploying your extension(s):
- Follow the command prompts
When you receive confirmation that the deploy was successful, a new app version in your Partner Dashboard displays, where you can submit a request for review. After the request for review has been submitted and the approval process is complete, you can release the new version from your Partner Dashboard and your templates will display in Flow's template library.