diff --git "a/data/evaluation/finetuned/evaluation_data.json" "b/data/evaluation/finetuned/evaluation_data.json" new file mode 100644--- /dev/null +++ "b/data/evaluation/finetuned/evaluation_data.json" @@ -0,0 +1,200 @@ +[ + { + "user_input":"Howw doo I use the Shopify CLI to createe a neww extensionn for Shopify Floww actions?", + "retrieved_contexts":[ + "A test app that works with the test web server\n\nA development store that has [Shopify Flow](https:\/\/apps.shopify.com\/flow) and the test app installed\n\n## Step 1: Create a Flow Action\n\nTo give your Flow action a meaningful name, use the following guidelines:\n\nUse a present\n\ntense verb + object acted on format. For example, `Place auction bid`.\n\nUse sentence case.\n\nDon't use punctuation.\n\nSeparate words using spaces.\n\n### Using Shopify CLI\n\nUse the Shopify CLI to generate a new extension:\n\n1. Navigate to your app directory. 2. Run the following command:\n\n```bash\n\n#!\/bin\/bash\n\nshopify app generate extension\n\n```\n\n3. Select the `Flow Action` as the type of extension. 4. Provide a meaningful name for your extension.\n\nAfter you've followed the prompts, Shopify CLI generates the extension\u2019s file representation in your app's `\/extensions` directory and gives you a success message. You can then go into your app's `\/extensions` directory and start editing your new extension.", + "Don't use punctuation.\n\nSeparate words using spaces.\n\n### Using Shopify CLI\n\nThe following steps show how to create a trigger that sends bid information to Shopify Flow when a bid is placed on an auction.\n\nUse the Shopify CLI to generate a new extension:\n\n1. Navigate to your app directory. 2. Run the following command:\n\n```bash\n\n#!\/bin\/bash\n\nshopify app generate extension\n\n```\n\n3. Select the `Flow Trigger` as the type of extension. 4. Provide a meaningful name for your extension.\n\nAfter you've followed the prompts, Shopify CLI generates the extension\u2019s file representation in your app's `\/extensions` directory and gives you a success message. You can then go into your app's `\/extensions` directory and start editing your new extension.\n\nThe file structure of your extension should look like the following:\n\n```\n\n\/auction\n\nbid\n\nplaced\n\nshopify.extension.toml\n\n```", + "1. Navigate to your app directory. 2. Run the following command:\n\n```bash\n\n#!\/bin\/bash\n\nshopify app generate extension\n\n```\n\n3. Select the `Flow Action` as the type of extension. 4. Provide a meaningful name for your extension.\n\nAfter you've followed the prompts, Shopify CLI generates the extension\u2019s file representation in your app's `\/extensions` directory and gives you a success message. You can then go into your app's `\/extensions` directory and start editing your new extension.\n\nThe file structure of your extension should look like the following:\n\n```\n\n\/place\n\nauction\n\nbid\n\nshopify.extension.toml\n\n```\n\nTo learn more about the extensions file structure, refer to [App structure](\/docs\/apps\/build\/cli-for-apps\/app-structure) and the documentation for your extension type.\n\n### Using the Partner Dashboard", + "```\n\n3. Select the `Flow Trigger` as the type of extension. 4. Provide a meaningful name for your extension.\n\nAfter you've followed the prompts, Shopify CLI generates the extension\u2019s file representation in your app's `\/extensions` directory and gives you a success message. You can then go into your app's `\/extensions` directory and start editing your new extension.\n\nThe file structure of your extension should look like the following:\n\n```\n\n\/auction\n\nbid\n\nplaced\n\nshopify.extension.toml\n\n```\n\nTo learn more about the extensions file structure, refer to [App structure](\/docs\/apps\/build\/cli-for-apps\/app-structure) and the documentation for your extension type.\n\n### Using the Partner Dashboard", + "When you create a new trigger extension using Shopify CLI, a basic version of the TOML configuration file structure is generated. In this guide, you'll learn about configuring the different sections and properties of the configuration file, including extension properties, extension fields, reference field types, custom field types, and more.\n\nThis guide will also inform you how to make HTTP requests to Flow to start the workflows in which your extension is the trigger.\n\n## TOML\n\n> Note: > Creating Flow extensions using Shopify CLI is an exciting new feature that is currently in development. As with any developing feature, it's important to note that the Flow's CLI capabilities will continue to evolve and improve over time. Developers can expect additional functionality, enhancements, and improvements to be added as development progresses. > >To create Flow extensions using [Shopify CLI](https:\/\/www.npmjs.com\/package\/@shopify\/cli), ensure you have the latest version installed." + ], + "reference_contexts":[ + "To create an action that merchants can use in their workflows, you need to add the action to your app. The action needs to contain the following information: The fields that the merchant needs to complete when they add the action to their workflows The URL that Shopify Flow uses to send (POST) the contents (JSON payload) of the action to your app You also need to configure your app to process the data from the POST request when it arrives and to send status codes back to Shopify Flow. To enhance the merchant experience and more closely integrate external systems, you can also [build a custom configuration page](\/docs\/apps\/build\/flow\/actions\/build-config-ui). To improve the reliability of your action, you can add [custom validation](\/docs\/apps\/build\/flow\/actions\/endpoints#custom-validation) for action properties. ## Requirements You have the following: A test web server that has access to the Internet, so that it can receive POST requests from Shopify Flow A test app that works with the test web server A development store that has [Shopify Flow](https:\/\/apps.shopify.com\/flow) and the test app installed ## Step 1: Create a Flow Action To give your Flow action a meaningful name, use the following guidelines: Use a present tense verb + object acted on format. For example, `Place auction bid`. Use sentence case. Don't use punctuation. Separate words using spaces. ### Using Shopify CLI Use the Shopify CLI to generate a new extension: 1. Navigate to your app directory. 2. Run the following command: ```bash #!\/bin\/bash shopify app generate extension ``` 3. Select the `Flow Action` as the type of extension. 4. Provide a meaningful name for your extension. After you've followed the prompts, Shopify CLI generates the extension\u2019s file representation in your app's `\/extensions` directory and gives you 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: ``` \/place auction bid shopify.extension.toml ``` To learn more about the extensions file structure, refer to [App structure](\/docs\/apps\/build\/cli-for-apps\/app-structure) and the documentation for your extension type. ### Using the Partner Dashboard 1. In your Partner Dashboard, click [Apps](https:\/\/partners.shopify.com\/current\/apps). 2. Select the app that you want to add your Shopify Flow action to. 3. Click **Extensions**, then click **Create** or **Create extension**. 4. Under the **Flow** tab, click **Flow\/Actions**. 5. In the **Extension name** field, name your action, such as `Place auction bid`. This name is used only for internal purposes. 6. Enter a title and description for the action. In the **Action Preview** area, you can see how the title and action display to merchants when they're choosing actions in Shopify Flow. 7. Enter the URL for the action execution endpoint that you created. Shopify Flow sends the action's JSON payload to this endpoint when it's about to execute your action. ## Step 2: Customize a Flow action configuration file In this section you'll use the default action template and update it to be a functional extension example. Once you have generated a Flow extension using Shopify CLI, follow the instructions below: 1. Change the description to `Place a bid on an auction`. 2. Update the `extensions.runtime_url` to an endpoint where you can receive the runtime request. 3. On the second `settings.fields` field, update the following values: - `type` to `number_decimal` - `key` to `amount` - `name` to `Bid Amount` - Add a `description` property and set it to `The amount of the bid` ```bash [[extensions]] name = \"Place Auction Bid\" type = \"flow_action\" handle = \"place-bid\" description = \"Place a bid on an auction\" runtime_url = \"https:\/\/your-server-domain\/path\/to\/action\/handler\" [settings] [[settings.fields]] type = \"customer_reference\" required = true [[settings.fields]] type = \"number_decimal\" key = \"amount\" name = \"Bid Amount\" description = \"The amount of the bid\" required = true ``` ##" + ], + "response":"To create a new extension for Shopify Flow actions using Shopify CLI, here\u2019s a simplified step-by-step guide you can follow:\n\n1. **Prepare Your Development Environment**:\n - Make sure you have a development store that has Shopify Flow and your test app installed. This will be necessary for testing your new extension.\n - Ensure Shopify CLI is installed in your machine. If it's not, you'll need to install it. Since Shopify CLI updates regularly, make sure you have the latest version to use all the newest features.\n\n2. **Navigate to Your App Directory**: \n - Open your terminal or command prompt.\n - Use the command line to navigate to your app\u2019s directory\/folder.\n\n3. **Generate a New Extension**:\n - In your terminal, while you are in your app directory, run the command:\n\n ```bash\n shopify app generate extension\n ```\n - This command starts the process to create a new extension in your app.\n\n4. **Choose the Type of Extension**:\n - You will be prompted to select the type of extension you want to create. Select `Flow Action` if you intend to create an action for Shopify Flow, or `Flow Trigger` if you're aiming to trigger a workflow.\n\n5. **Name Your Extension**:\n - Provide a meaningful name following the guidelines (use present tense verb + object acted on, sentence case, no punctuation, and separate words using spaces). For example, `Place auction bid` for a Flow action.\n\n6. **Edit Your New Extension**:\n - After you've followed the prompts, the Shopify CLI will generate your extension and place it in the `\/extensions` directory of your app. You\u2019ll get a success message once it's done.\n - Find your new extension in the `\/extensions` directory and start editing according to your needs. Each extension will have its `shopify.extension.toml` configuration file among others, which you can configure as needed.\n\n7. **Learn About Extensions File Structure**:\n - To understand how to organize and configure your extension effectively, refer to additional documentation on app structure and your specific extension type mentioned in the Shopify CLI or Shopify Developers documentation.\n\nRemember, the goal of these steps is to set up your extension's basic structure, which you can then further develop and tailor to meet your specific requirements for Shopify Flow actions or triggers. This guide uses straightforward, non-technical language to make the process accessible, even if you're new to Shopify CLI or extension development.", + "reference":"To use the Shopify CLI to generate a new extension for Shopify Flow actions, follow these steps: 1. Navigate to your app directory. 2. Run the command `shopify app generate extension`. 3. Select `Flow Action` as the type of extension. 4. Provide a meaningful name for your extension. After completing these steps, Shopify CLI generates the extension\u2019s file representation in your app's `\/extensions` directory and provides a success message. You can then start editing your new extension in the `\/extensions` directory." + }, + { + "user_input":"How do you configure a web server to handle Shopify Flow actions?", + "retrieved_contexts":[ + "```bash [[extensions]] name = \"Place Auction Bid\" type = \"flow_action\" handle = \"place-bid\" description = \"Place a bid on an auction\" runtime_url = \"https:\/\/your-server-domain\/path\/to\/action\/handler\"\n\n[settings]\n\n[[settings.fields]]\n\ntype = \"customer_reference\"\n\nrequired = true\n\n[[settings.fields]] type = \"number_decimal\" key = \"amount\" name = \"Bid Amount\" description = \"The amount of the bid\" required = true ```\n\n## Step 3: Configure your web server\n\nTo build a Shopify Flow action, you need to add a service to your web server to listen for the JSON payload that Shopify Flow sends when the action runs.\n\nOptionally, you can also add the following:\n\nAn endpoint to validate actions\n\nA [custom configuration page](\/docs\/apps\/build\/flow\/actions\/build\n\nconfig\n\nui), and an endpoint that lets merchants preview your custom configuration page\n\nAdd the following API endpoints to your server:", + "## 1. Configure your web server\n\nTo begin, configure your web server to listen for Shopify Flow callbacks.\n\n1. Configure a URL in your web server to listen for the trigger lifecycle callbacks from Shopify Flow. 2. Configure your web server to verify the HMAC header in the trigger lifecycle callback with your client secret.\n\nThe HMAC header is located in the following HTTP header: `x-shopify-hmac-sha256`. If you are using a Ruby-based web framework, then the header is `http-x-shopify-hmac-sha256`.\n\n3. Configure your web server to respond within 5 seconds when it receives a trigger lifecycle callback.\n\n## 2. Process and store callback data\n\nAfter you've added support to listen for Shopify Flow callbacks, you can configure your web server to process and store the callback data.", + "To create an action that merchants can use in their workflows, you need to add the action to your app. The action needs to contain the following information:\n\nThe fields that the merchant needs to complete when they add the action to their workflows\n\nThe URL that Shopify Flow uses to send (POST) the contents (JSON payload) of the action to your app\n\nYou also need to configure your app to process the data from the POST request when it arrives and to send status codes back to Shopify Flow.\n\nTo enhance the merchant experience and more closely integrate external systems, you can also [build a custom configuration page](\/docs\/apps\/build\/flow\/actions\/build-config-ui). To improve the reliability of your action, you can add [custom validation](\/docs\/apps\/build\/flow\/actions\/endpoints#custom-validation) for action properties.\n\n## Requirements\n\nYou have the following:\n\nA test web server that has access to the Internet, so that it can receive POST requests from Shopify Flow", + "## Requirements\n\nMake sure that you have the following:\n\nA test web server that you can use to send information to Shopify Flow. You can use an existing web server. This web server needs to be able to send POST requests to Shopify's [GraphQL Admin API](\/docs\/api\/admin\n\ngraphql).\n\nA test app that works with the test web server and can send HTTP requests.\n\nA development store that has [Shopify Flow](https:\/\/apps.shopify.com\/flow) and the test app installed.\n\nYour application has access to the `read_customers` scope. The trigger you will build using this tutorial will be using a customer reference which requires that scope.\n\n## Step 1: Create a Flow trigger extension\n\nTo give your Flow action a meaningful name, use the following guidelines:\n\nUse an object acted on + past tense verb format. For example, `Auction bid placed`.\n\nUse sentence case.\n\nDon't use punctuation.\n\nSeparate words using spaces.\n\n### Using Shopify CLI", + "To enhance the merchant experience and more closely integrate external systems, you can also [build a custom configuration page](\/docs\/apps\/build\/flow\/actions\/build-config-ui). To improve the reliability of your action, you can add [custom validation](\/docs\/apps\/build\/flow\/actions\/endpoints#custom-validation) for action properties.\n\n## Requirements\n\nYou have the following:\n\nA test web server that has access to the Internet, so that it can receive POST requests from Shopify Flow\n\nA test app that works with the test web server\n\nA development store that has [Shopify Flow](https:\/\/apps.shopify.com\/flow) and the test app installed\n\n## Step 1: Create a Flow Action\n\nTo give your Flow action a meaningful name, use the following guidelines:\n\nUse a present\n\ntense verb + object acted on format. For example, `Place auction bid`.\n\nUse sentence case.\n\nDon't use punctuation.\n\nSeparate words using spaces.\n\n### Using Shopify CLI\n\nUse the Shopify CLI to generate a new extension:" + ], + "reference_contexts":[ + "Step 3: Configure your web server To build a Shopify Flow action, you need to add a service to your web server to listen for the JSON payload that Shopify Flow sends when the action runs. Optionally, you can also add the following: An endpoint to validate actions A [custom configuration page](\/docs\/apps\/build\/flow\/actions\/build config ui), and an endpoint that lets merchants preview your custom configuration page Add the following API endpoints to your server: | Endpoint | Purpose | | --- | --- | | [Flow action execution](\/docs\/apps\/flow\/actions\/endpoints#flow-action-execution) | The endpoint where the automation tool sends your action's payload. The payload contains data that you can use to execute the action in your app.| | [Custom configuration page preview](\/docs\/apps\/flow\/actions\/endpoints#custom-configuration-page-preview) | An endpoint that provides data about your [custom configuration page](\/docs\/apps\/build\/flow\/actions\/build-config-ui) to display in the automation tool. This endpoint is required if you want to use a custom configuration page.| | [Custom validation](\/docs\/apps\/flow\/actions\/endpoints#custom-validation) | An endpoint that validates the contents of merchant-configurable properties in an action payload when an action is saved. This endpoint is required if you want to use a custom configuration page.| To learn more about the endpoint requirements for your server, refer to [Action endpoints](\/docs\/apps\/build\/flow\/actions\/endpoints). To learn how to create a custom configuration page, refer to [Build a custom configuration page](\/docs\/apps\/build\/flow\/actions\/build-config-ui). ##" + ], + "response":"To get your web server ready to work with Shopify Flow actions, here's a simple guide you can follow:\n\n1. **Set Up Your Web Server**: Your web server should be configured to accept incoming POST requests from Shopify Flow. This means setting up a specific URL (endpoint) on your server where Shopify Flow can send data. This is where you listen for Shopify Flow's JSON payloads that describe the actions to be performed.\n\n2. **Verify Requests**: For security, Shopify sends a special code with each request called an HMAC (Hash-Based Message Authentication Code) in the HTTP header `x-shopify-hmac-sha256`. Your server needs to check this code to make sure the request is really coming from Shopify. This involves a bit of coding to compare Shopify's HMAC with a hash you generate from the incoming request using your app's client secret.\n\n3. **Respond Quickly**: Your server must process the Shopify Flow request and respond within 5 seconds. If it takes longer, Shopify might think the request failed.\n\n4. **Handle the JSON Payload**: Your endpoint will receive data in JSON format. This data includes the action fields defined in your app, like `customer_reference` and `amount` for a bid. You'll need to extract these values from the JSON and use them in your server's logic to perform the action\u2014like placing a bid in an auction.\n\n5. **Reply to Shopify Flow**: After processing the request, you should send a response back to Shopify Flow. This usually includes HTTP status codes to indicate whether the action was successfully processed (e.g., `200 OK` for success).\n\n6. **Custom Configuration and Validation (Optional)**: If you want to offer merchants a way to configure your action specifically for their needs or validate action properties, you can create a custom configuration page and validation endpoints. This is more advanced and involves creating additional web pages and more complex server logic.\n\nTo summarize, you're setting up a specific spot on your server to listen for instructions from Shopify Flow, making sure those instructions are legitimate, acting on them quickly, and then letting Shopify Flow know the result. If you're not familiar with terms like \"JSON payload\" or \"HMAC verification,\" it may be helpful to work with a developer or use more detailed guides and examples provided by Shopify or web development resources.", + "reference":"To configure a web server to handle Shopify Flow actions, you need to add a service to your web server to listen for the JSON payload that Shopify Flow sends when the action runs. Additionally, you can add an endpoint to validate actions, a custom configuration page, and an endpoint that lets merchants preview your custom configuration page. The necessary API endpoints include: Flow action execution, Custom configuration page preview, and Custom validation." + }, + { + "user_input":"How can I test an action created in the Partner Dashboard using Shopify Flow?", + "retrieved_contexts":[ + "1. Navigate to your app directory. 2. Run the following command to start using draft versions of your extension(s):\n\n```bash\n\n#!\/bin\/bash\n\nshopify app dev\n\n```\n\n3. Follow the prompts.\n\n## Step 5: Test the action\n\nAfter you've created an action in the Partner Dashboard and added support for it in your web server, you can test the action in Shopify Flow on your development store.\n\n1. In your development store, create a [workflow](https:\/\/www.shopify.com\/admin\/apps\/flow) that uses the action. For example, add the trigger that you created in the [Triggers guide](\/docs\/apps\/build\/flow\/triggers\/create) and this action to a workflow.\n\n2. If you created a custom configuration page, then ensure that the preview displays and that the custom configuration page is accessible.\n\n3. If you added any custom validation, then ensure that it works as expected.\n\n4. Trigger the workflow. For example, in your web server, run the event that sends the trigger information to Shopify Flow.", + "shopify.extension.toml\n\n```\n\nTo learn more about the extensions file structure, refer to [App structure](\/docs\/apps\/build\/cli-for-apps\/app-structure) and the documentation for your extension type.\n\n### Using the Partner Dashboard\n\n1. In your Partner Dashboard, click [Apps](https:\/\/partners.shopify.com\/current\/apps). 2. Select the app that you want to add your Shopify Flow action to. 3. Click **Extensions**, then click **Create** or **Create extension**. 4. Under the **Flow** tab, click **Flow\/Actions**. 5. In the **Extension name** field, name your action, such as `Place auction bid`. This name is used only for internal purposes. 6. Enter a title and description for the action. In the **Action Preview** area, you can see how the title and action display to merchants when they're choosing actions in Shopify Flow. 7. Enter the URL for the action execution endpoint that you created. Shopify Flow sends the action's JSON payload to this endpoint when it's about to execute your action.", + "## How actions work\n\nAn action is a workflow component in Shopify Flow. It represents a task that's executed in a store or in an app when certain conditions are met. You can connect your app to Shopify Flow so that your app receives data when a workflow action runs.\n\nThis guide shows you how to add an action to your app so that merchants can use it in their workflows.\n\n! [A diagram that show how third party actions interface with Flow ](\/assets\/apps\/flow\/action_diagram.png)\n\n## Next steps\n\nFollow our step by step guide on [how to create and test a Flow action](\/docs\/apps\/build\/flow\/actions\/create).\n\nCheck out our action endpoint guide for more information on how to setup an [execution endpoint](\/docs\/apps\/build\/flow\/actions\/endpoints#flow\n\naction\n\nexecution), a [custom configuration page preview endpoint](\/docs\/apps\/build\/flow\/actions\/endpoints#custom\n\nconfiguration\n\npage\n\npreview) and [custom validation](\/docs\/apps\/build\/flow\/actions\/endpoints#custom\n\nvalidation).", + "Follow our step by step guide on [how to create and test a Flow action](\/docs\/apps\/build\/flow\/actions\/create).\n\nCheck out our action endpoint guide for more information on how to setup an [execution endpoint](\/docs\/apps\/build\/flow\/actions\/endpoints#flow\n\naction\n\nexecution), a [custom configuration page preview endpoint](\/docs\/apps\/build\/flow\/actions\/endpoints#custom\n\nconfiguration\n\npage\n\npreview) and [custom validation](\/docs\/apps\/build\/flow\/actions\/endpoints#custom\n\nvalidation).\n\nLearn more about how to [return complex data](\/docs\/apps\/build\/flow\/configure\n\ncomplex\n\ndata\n\ntypes) in a Flow action.\n\nInterested in building a custom configuration page? Follow this [guide](\/docs\/apps\/build\/flow\/actions\/build\n\nconfig\n\nui) to learn more.", + "### Using the Partner Dashboard\n\n1. Open your [Partner Dashboard](https:\/\/partners.shopify.com). 2. Click the app that you want to add your Shopify Flow trigger to. 3. Click **Extensions**, then click **Create** or **Create extension**. 4. Under **Flow**, click the **Flow\/Triggers** card. 5. Enter an internal extension name for your trigger and click **Save**. 6. Enter a title and description for the trigger that will be shown to merchants. 7. Copy the GraphQL endpoint that displays under the **Trigger description** field to a text file. Your app uses this endpoint to send your POST request to Shopify Flow. The endpoint follows the format `https:\/\/{shop}.myshopify.com\/admin\/api\/latest\/graphql.json`. 8. In the **Request body properties** section, click **Add property**, choose a data type, and create the properties that display in Shopify Flow when a merchant chooses your trigger.\n\n## Step 2: Customize a Flow trigger configuration file" + ], + "reference_contexts":[ + "Step 4: Enable the draft version of your action Running [`app dev`](\/docs\/api\/shopify-cli\/app\/app-dev) allows changes made to local files to update the draft version of your Flow task extensions. The draft version is only available in your development store. > Note: > When [`app dev`](\/docs\/api\/shopify-cli\/app\/app-dev) is running and \"Development store preview\" is enabled, the draft version of a task will appear in your development store _in place_ of the deployed version. Other shops will continue to see the deployed version of your task (if one exists). Draft versions can be identified by the \"draft\" badge. To see the deployed version of the task in your development store, turn off \"Development store preview\" in the \"Extensions\" section of your app in [Shopify Partners](https:\/\/partners.shopify.com\/). 1. Navigate to your app directory. 2. Run the following command to start using draft versions of your extension(s): ```bash #!\/bin\/bash shopify app dev ``` 3. Follow the prompts. ## Step 5: Test the action After you've created an action in the Partner Dashboard and added support for it in your web server, you can test the action in Shopify Flow on your development store. 1. In your development store, create a [workflow](https:\/\/www.shopify.com\/admin\/apps\/flow) that uses the action. For example, add the trigger that you created in the [Triggers guide](\/docs\/apps\/build\/flow\/triggers\/create) and this action to a workflow. 2. If you created a custom configuration page, then ensure that the preview displays and that the custom configuration page is accessible. 3. If you added any custom validation, then ensure that it works as expected. 4. Trigger the workflow. For example, in your web server, run the event that sends the trigger information to Shopify Flow. When the workflow completes, your web server has sent data to Shopify Flow because of the trigger. Shopify Flow has sent this data to a web server that logged the information to its console because of the action. ## Step 6: Deploy your extension > Note: > Deploying extensions using the `app deploy` command also publishes the extensions. We recommend testing changes by using [`app dev`](\/docs\/api\/shopify-cli\/app\/app-dev) or deploying to a test app before deploying them to a production app. Use Shopify CLI to deploy your extensions: 1. Navigate to your app directory. 2. Run the following command to start deploying your extension(s): ```bash #!\/bin\/bash shopify app deploy ``` 3. Follow the prompts. When you receive confirmation that the deploy was successful, your extensions have been released. ## Verifying requests For security reasons, make sure that you verify the following elements in each request: The POST request's HMAC header (either `x shopify hmac sha256` or `http x shopify hmac sha256`). The HMAC header should be verified before you process the payload. For more information, refer to [Verifying requests](\/docs\/apps\/build\/flow\/actions\/endpoints#verifying requests). The payload `handle`. This ID should match the `handle` of the action that you created, and can be retrieved from the payload preview. ## Next steps Connect your app to Shopify Flow so that events that occur in your app can [trigger workflows](\/docs\/apps\/build\/flow\/triggers). Learn how to receive [lifecycle events from Shopify Flow](\/docs\/apps\/build\/flow\/track lifecycle events) about the stores that are using your triggers in enabled workflows. Learn more about how to [return complex data](\/docs\/apps\/build\/flow\/configure complex data types) in a Flow action." + ], + "response":"To test an action you've created in the Partner Dashboard using Shopify Flow, follow these steps:\n\n1. **Start Your Environment**: Open your app directory and run `shopify app dev` in your command line. This prepares your development environment for testing.\n\n2. **Create a Workflow in Shopify Flow**: Go to your development store's Shopify admin, then navigate to the Flow app. Here, create a new workflow that includes the action you developed. Start by picking a trigger (an event that starts the workflow) that matches the one you designed in the Triggers guide.\n\n3. **Check Custom Configuration (If Applicable)**: If your action has a custom configuration page, ensure that this page is showing up correctly and is accessible within the workflow.\n\n4. **Verify Custom Validation**: If you added any custom validation (rules to make sure the input or actions are correct) to your action, test these to confirm they behave as expected.\n\n5. **Trigger the Workflow**: Finally, to see your action in action, you'll need to trigger the workflow. This usually means performing the action in your web server that mimics the event which starts the workflow. For example, if your trigger is \"Order Created,\" you would simulate an order being created which should then trigger your custom Shopify Flow action.\n\nRemember, all these steps are part of a development process, meant to be done in a testing or development environment, not in your live store. This way, you can ensure everything works perfectly before launching your action to actual users.", + "reference":"After you've created an action in the Partner Dashboard and added support for it in your web server, you can test the action in Shopify Flow on your development store. First, create a workflow in your development store that uses the action. Ensure that any custom configuration page displays correctly and that custom validation works as expected. Then, trigger the workflow by running the event in your web server that sends the trigger information to Shopify Flow. When the workflow completes, your web server will have sent data to Shopify Flow because of the trigger, and Shopify Flow will have sent this data to a web server that logged the information to its console because of the action." + }, + { + "user_input":"how do you use toml when making new trigger extensions with shopify cli and what are the important parts to configure?", + "retrieved_contexts":[ + "When you create a new trigger extension using Shopify CLI, you'll get a basic version of the TOML configuration file structure which should look like the following example:\n\n```bash\n\n[[extensions]]\n\nname = \"Auction Bid\"\n\ntype = \"flow_trigger\"\n\nhandle = \"auction\n\nbid\"\n\ndescription = \"Your description\"\n\n[settings]\n\n[[settings.fields]]\n\ntype = \"customer_reference\"\n\n[[settings.fields]] type = \"single_line_text_field\" key = \"your field key\" ```\n\n### Trigger extension properties\n\nExtension properties are listed in the `[[extensions]]` section and enable you to define the interface between Flow and your event.", + "When you create a new trigger extension using Shopify CLI, a basic version of the TOML configuration file structure is generated. In this guide, you'll learn about configuring the different sections and properties of the configuration file, including extension properties, extension fields, reference field types, custom field types, and more.\n\nThis guide will also inform you how to make HTTP requests to Flow to start the workflows in which your extension is the trigger.\n\n## TOML\n\n> Note: > Creating Flow extensions using Shopify CLI is an exciting new feature that is currently in development. As with any developing feature, it's important to note that the Flow's CLI capabilities will continue to evolve and improve over time. Developers can expect additional functionality, enhancements, and improvements to be added as development progresses. > >To create Flow extensions using [Shopify CLI](https:\/\/www.npmjs.com\/package\/@shopify\/cli), ensure you have the latest version installed.", + "### Folder structure\n\n```\n\n\/my\n\nextension\n\nname\n\nshopify.extensions.toml\n\nschema.graphql\n\n```\n\n### `shopify.extension.toml` file\n\n```bash [[extensions]] name = \"Place auction bid\" type = \"flow_action\" handle = \"auction-bid\" description = \"My description\" runtime_url = \"https:\/\/{url}.com\/api\/execute\" schema = \".\/schema.graphql\" return_type_ref = \"Auction\" ```\n\n## Referencing the return type schema in an action extension's TOML\n\nAfter a schema file has been defined, it can be referenced in the action extension's TOML by setting `extensions.schema` to the relative path of the schema file, and `extension.return_type_ref` to a type defined in the referenced schema file. The schema defined above can be referenced by setting the following fields:\n\n| Property Name | Property value | | ------------------- | --------------- | | `extensions.schema` | .\/schema.graphql | | `extensions.return_type_ref` | Auction |\n\n## Referencing the return type schema in a trigger extension's TOML", + "```\n\n3. Select the `Flow Trigger` as the type of extension. 4. Provide a meaningful name for your extension.\n\nAfter you've followed the prompts, Shopify CLI generates the extension\u2019s file representation in your app's `\/extensions` directory and gives you a success message. You can then go into your app's `\/extensions` directory and start editing your new extension.\n\nThe file structure of your extension should look like the following:\n\n```\n\n\/auction\n\nbid\n\nplaced\n\nshopify.extension.toml\n\n```\n\nTo learn more about the extensions file structure, refer to [App structure](\/docs\/apps\/build\/cli-for-apps\/app-structure) and the documentation for your extension type.\n\n### Using the Partner Dashboard", + "This guide provides explanations of key topics for building and deploying a Flow template extension. This includes the TOML configuration file, localization, and the template approval process.\n\n## TOML\n\nWhen you first create a new Flow template extensions through Shopify CLI, you get a basic version of the `shopify.extension.toml` file structure that looks like the following example:\n\n```toml\n\n[[extensions]]\n\nname = \"t:name\"\n\ntype = \"flow_template\"\n\nhandle = \"example\n\nname\"\n\ndescription = \"t:description\"\n\n[extensions.template]\n\ncategories = [\"orders\", \"risk\"]\n\nmodule = \".\/template.flow\"\n\nrequire_app = false\n\ndiscoverable = true\n\nenabled = true\n\n```\n\n### Flow template extension fields" + ], + "reference_contexts":[ + "When you create a new trigger extension using Shopify CLI, a basic version of the TOML configuration file structure is generated. In this guide, you'll learn about configuring the different sections and properties of the configuration file, including extension properties, extension fields, reference field types, custom field types, and more. This guide will also inform you how to make HTTP requests to Flow to start the workflows in which your extension is the trigger. ## TOML > Note: > Creating Flow extensions using Shopify CLI is an exciting new feature that is currently in development. As with any developing feature, it's important to note that the Flow's CLI capabilities will continue to evolve and improve over time. Developers can expect additional functionality, enhancements, and improvements to be added as development progresses. > >To create Flow extensions using [Shopify CLI](https:\/\/www.npmjs.com\/package\/@shopify\/cli), ensure you have the latest version installed. When you create a new trigger extension using Shopify CLI, you'll get a basic version of the TOML configuration file structure which should look like the following example: ```bash [[extensions]] name = \"Auction Bid\" type = \"flow_trigger\" handle = \"auction bid\" description = \"Your description\" [settings] [[settings.fields]] type = \"customer_reference\" [[settings.fields]] type = \"single_line_text_field\" key = \"your field key\" ``` ### Trigger extension properties Extension properties are listed in the `[[extensions]]` section and enable you to define the interface between Flow and your event. | Property name | Description | Rules | | --------------------------- | ------------------------------------------------------------- | -------------------------------------- | | `name`
Required<\/span> | Name of your extension. Will be the merchant-facing name of your task in the editor. This should be something that is human readable. | | | `type`
Required<\/span> | The type of your extension. This should always be set to \u201cflow_trigger\u201d for Flow triggers. | - Value must be `flow_trigger`. | `handle`
Required<\/span> | A unique identifier for your extension. This property cannot be changed once you\u2019ve run the `dev` or `deploy` command. | - Cannot exceed 30 characters.
- Must be unique across your app's extensions.
- Must only contain alphanumeric characters and hyphens. | | `description`
Optional<\/span> | A description of your extension. This description will be shown in the Flow editor navigation panel. | | ### Trigger extension fields Trigger extension fields are listed in the `[settings]` section, with each field using a `[[settings.field]]` header. These fields define the payload your event will send to Flow. You can add more than one field to your Flow trigger. The order of the fields in the TOML file is preserved when they're being rendered in the editor configuration panel. When sending a trigger payload, all fields defined in a trigger are required. | Property name | Description | Rules | | ------------------------------ | --------------------------------------------------------------------------------------------------- | --------------------------------| | `type`
Required<\/span> | The field type. | - [Accepted custom field types](#custom-field-types).
- [Accepted reference field types](#reference-field-types). | | `key`
Optional<\/span> | A unique key that identifies your field. This should be human readable since it will appear in the Flow editor in the environment picker menu. | - Required for custom field types.
Should only contain alphabetic values or spaces.
- This property is not valid for reference field types. | | `description`
Required<\/span> | A description of the field. This will appear in the Flow editor configuration panel. | ###" + ], + "response":"Using TOML with Shopify CLI for creating new trigger extensions involves configuring a `shopify.extension.toml` file that specifies how your extension will work. TOML stands for Tom's Obvious, Minimal Language, which is a configuration file format that's easy to read due to its clear semantics. Here's a straightforward breakdown of the important parts you need to configure:\n\n### Important Parts of the TOML Configuration:\n\n1. **`[[extensions]]` block:** This is where you define the basic information about your extension. It includes properties such as `name`, `type`, `handle`, and `description`. \n\n - `name`: The name of your extension.\n - `type`: The type of extension, like `flow_trigger` for trigger extensions or `flow_action` for action extensions.\n - `handle`: A unique identifier for your extension.\n - `description`: A brief description of what your extension does.\n\n2. **`[settings]` and `[[settings.fields]]` blocks:** These are for setting up the fields that users can interact with when they use your extension. You can define various types of fields, such as customer references or text fields, and set properties like `type` and `key` for those fields.\n\n - `type`: The type of field, which determines what kind of data it can hold. Examples include `customer_reference` for customer data or `single_line_text_field` for text.\n - `key`: A unique identifier for the field which can be used in the extension's code to access the data entered by a user.\n\n3. **`runtime_url`** (for action extensions): Specifies the URL where your extension's logic is hosted. This is where Shopify sends a request when the extension is triggered.\n\n4. **`schema` and `return_type_ref`** (for action extensions): If your extension acts upon data, these fields tell Shopify how to understand the data your extension handles. \n - `schema`: A relative path to a `.graphql` file that defines the data structures your extension uses or modifies.\n - `return_type_ref`: Specifies a type from your `.graphql` schema that the extension returns after execution.\n\n### Creating and Modifying the TOML File:\n\nWhen you initiate a new trigger extension using Shopify CLI, it automatically generates a basic `shopify.extension.toml` file in your project's `\/extensions` directory. To modify this file:\n\n1. Navigate to your project's `\/extensions` directory.\n2. Open the `shopify.extension.toml` file in your text editor.\n3. Edit the properties within the `[[extensions]]` block and add any necessary `settings` fields according to the needs of your extension.\n4. If you're working with an action extension, make sure to correctly set the `runtime_url`, `schema`, and `return_type_ref` properties.\n\nRemember, the key to effectively using TOML in Shopify CLI is to thoroughly configure these properties to accurately represent your extension's functionality, enabling smooth interaction between Shopify's Flow and your extension. These settings define how your extension appears to users within Shopify's Flow and dictate the data it can receive or send.", + "reference":"When you create a new trigger extension using Shopify CLI, a basic version of the TOML configuration file structure is generated. Important parts to configure include extension properties such as `name`, `type`, `handle`, and `description` in the `[[extensions]]` section, and trigger extension fields in the `[settings]` section, where each field uses a `[[settings.field]]` header. These fields define the payload your event will send to Flow, and all fields defined in a trigger are required when sending a trigger payload." + }, + { + "user_input":"How do you use Shopify App Bridge to render a custom configuration page in Shopify Flow, and what are the requirements for setting up the necessary endpoints?", + "retrieved_contexts":[ + "App Bridge components\n\nApp Bridge actions specific to the custom configuration page\n\n## Implementing a custom configuration page\n\nTo build a custom configuration page, you'll [use Shopify App Bridge to render a page from your app page in Shopify Flow](#use-shopify-app-bridge-to-render-your-app-page).\n\nFrom the context of the custom configuration page, you can then [access step and property information](#access-action-information) that you can use to display the appropriate information.\n\nYou can also [add additional buttons](#add-buttons-to-the-app-bridge-title-bar) to the App Bridge title bar, or [trigger a redirect to the previous page](#return-to-the-previous-page).\n\n## Use Shopify App Bridge to render your app page\n\n> Note: > The specifics of the Custom Configuration Page integration varies between Shopify App Bridge versions. Make sure you implement the integration specific to your Shopify App Bridge version.", + "In this tutorial, you'll learn how to render a custom configuration page in Shopify Flow, customize the page frame, and access data relevant to your action in the custom configuration page context.\n\n## Requirements\n\nYou've created a [Partner account](https:\/\/www.shopify.com\/partners).\n\nYou've [created an app](\/docs\/apps\/build\/scaffold\n\napp).\n\n## Resources\n\nTo implement this feature, you'll use the following:\n\n[Shopify App Bridge](\/docs\/api\/app\n\nbridge)\n\nApp Bridge components\n\nApp Bridge actions specific to the custom configuration page\n\n## Implementing a custom configuration page\n\nTo build a custom configuration page, you'll [use Shopify App Bridge to render a page from your app page in Shopify Flow](#use-shopify-app-bridge-to-render-your-app-page).\n\nFrom the context of the custom configuration page, you can then [access step and property information](#access-action-information) that you can use to display the appropriate information.", + "You can also [add additional buttons](#add-buttons-to-the-app-bridge-title-bar) to the App Bridge title bar, or [trigger a redirect to the previous page](#return-to-the-previous-page).\n\n## Use Shopify App Bridge to render your app page\n\n> Note: > The specifics of the Custom Configuration Page integration varies between Shopify App Bridge versions. Make sure you implement the integration specific to your Shopify App Bridge version.\n\nTo render your custom configuration page, you need to integrate Shopify App Bridge on the route that you want to render. To learn about setting up Shopify App Bridge, refer to one of the following pages:\n\n[Getting started with Shopify App Bridge](\/docs\/api\/app\n\nbridge\/previous\n\nversions\/app\n\nbridge\n\nfrom\n\nnpm\/app\n\nsetup)\n\n[Getting started with App Bridge React](\/docs\/api\/app\n\nbridge\n\nlibrary#react)\n\n### Access action information\n\nIn the context of the custom configuration page, Shopify Flow makes the following action information available:", + "
\"A<\/figure>\n\nYour custom configuration page is then displayed in a frame in the Shopify admin.\n\n
\"The<\/figure>\n\nIn this tutorial, you'll learn how to render a custom configuration page in Shopify Flow, customize the page frame, and access data relevant to your action in the custom configuration page context.\n\n## Requirements\n\nYou've created a [Partner account](https:\/\/www.shopify.com\/partners).", + "| Endpoint | Purpose | | --- | --- | | [Flow action execution](\/docs\/apps\/flow\/actions\/endpoints#flow-action-execution) | The endpoint where the automation tool sends your action's payload. The payload contains data that you can use to execute the action in your app.| | [Custom configuration page preview](\/docs\/apps\/flow\/actions\/endpoints#custom-configuration-page-preview) | An endpoint that provides data about your [custom configuration page](\/docs\/apps\/build\/flow\/actions\/build-config-ui) to display in the automation tool. This endpoint is required if you want to use a custom configuration page.| | [Custom validation](\/docs\/apps\/flow\/actions\/endpoints#custom-validation) | An endpoint that validates the contents of merchant-configurable properties in an action payload when an action is saved. This endpoint is required if you want to use a custom configuration page.|\n\n## General endpoint requirements\n\nThe requirements for Shopify Flow action endpoints are as follows:" + ], + "reference_contexts":[ + "<1-hop>\n\nTo give merchants a more seamless action configuration experience, and to allow them to manage resources that are external to Shopify Flow, you can embed a page from your app in the Shopify Flow editor. In your Shopify Flow action configuration, merchants see a preview with an image and text that's fetched from your [custom configuration page preview URL](\/docs\/apps\/build\/flow\/actions\/endpoints#custom-configuration-page-preview). Merchants can click the button to access the custom configuration page.
\"A<\/figure> Your custom configuration page is then displayed in a frame in the Shopify admin.
\"The<\/figure> In this tutorial, you'll learn how to render a custom configuration page in Shopify Flow, customize the page frame, and access data relevant to your action in the custom configuration page context. ## Requirements You've created a [Partner account](https:\/\/www.shopify.com\/partners). You've [created an app](\/docs\/apps\/build\/scaffold app). ## Resources To implement this feature, you'll use the following: [Shopify App Bridge](\/docs\/api\/app bridge) App Bridge components App Bridge actions specific to the custom configuration page ## Implementing a custom configuration page To build a custom configuration page, you'll [use Shopify App Bridge to render a page from your app page in Shopify Flow](#use-shopify-app-bridge-to-render-your-app-page). From the context of the custom configuration page, you can then [access step and property information](#access-action-information) that you can use to display the appropriate information. You can also [add additional buttons](#add-buttons-to-the-app-bridge-title-bar) to the App Bridge title bar, or [trigger a redirect to the previous page](#return-to-the-previous-page). ##", + "<2-hop>\n\nUse Shopify App Bridge to render your app page > Note: > The specifics of the Custom Configuration Page integration varies between Shopify App Bridge versions. Make sure you implement the integration specific to your Shopify App Bridge version. To render your custom configuration page, you need to integrate Shopify App Bridge on the route that you want to render. To learn about setting up Shopify App Bridge, refer to one of the following pages: [Getting started with Shopify App Bridge](\/docs\/api\/app bridge\/previous versions\/app bridge from npm\/app setup) [Getting started with App Bridge React](\/docs\/api\/app bridge library#react) ### Access action information In the context of the custom configuration page, Shopify Flow makes the following action information available: **A `step_reference` search parameter **: `step_reference` is a unique ID for the step within a workflow, and can be used to identify the resource that the merchant is requesting. **Property data **: Properties contains the extension fields data that make up your [action payload schema](\/docs\/apps\/build\/flow\/actions\/endpoints#request). The properties are passed as an object containing the properties as key value pairs: ```json { : } ``` ### Shopify App Bridge integration for versions 4.X.X and up #### Register to the Custom Configuration Page's intent To access property data with Shopify App Bridge version 4.X.X and up, you will need to use the `shopify.intents` API. The following example code allows you to register to the Custom Configuration Page's intent: ```jsx import { useAppBridge } from '@shopify\/app-bridge-react' const Application = () => { const shopify = useAppBridge() const [intent, setIntent] = useState({}) useEffect(() => { const cleanup = shopify.intents.register((intent) => { setIntent(intent) }) return () => cleanup() }, []); return <>...<\/> } ``` The `intent` object will contain the following data: | Field | Data Type | Description | | ------- | --------- | ----------------------------------------------------------------------------------------------------- | | action | `string` | The action that has been registered for. In the case of the Custom Configuration Page, it will always be set to `configure`. | | type | `string` | A GID with the following structure: `gid:\/\/flow\/stepReference\/`. | | data | `object` | An object that contains the `properties` data. | | finish | `method` | A function that allows you to navigate to the previous page. | The register method also returns a cleanup function, which you can use to unregister from the intent when your component is unmounting. #### Return to the previous page By default, the title bar of the custom configuration page includes an **Exit** button that the user can use to return to the previous page. You can choose to trigger a redirect to the previous page using the `intent.finish()` method: ```jsx