Execute GraphQL request
This Flow Companion action allows you to execute GraphQL queries and mutations against the Shopify Admin API (version 2025-07) directly from your workflows.
Explore available queries and mutations in the GraphQL Admin API reference.
Configuration
When configuring this action in your workflow, you'll work with two main components:
Action Configuration
- Click the Configure button to open the GraphQL editor
- Write your GraphQL query or mutation with full autocomplete support
- The editor suggests available fields as you type
- Syntax validation helps catch errors before saving
Action Fields
-
Variables: Enter JSON variables for your GraphQL query in this field. You can use workflow data and variables from previous steps.
JSON format example:
{ "orderId": "{{ order.id }}", "tags": ["urgent", "vip-customer"], "updateNote": "Updated by Flow Companion" }
API permissions management
If your GraphQL request requires API permissions that haven't been granted to the Flow Companion app, you'll receive an Access denied
error.
To manage permissions:
- Click the grant additional permissions link above the GraphQL editor
- A modal will open showing all available Shopify API scopes
- Already granted permissions are marked with a
Granted
badge - Select the permissions you need by checking the boxes
- Click Request selected scopes to initiate the permission request
- Follow Shopify's prompts to approve the permissions
Once permissions are granted, you can execute your GraphQL request successfully.
Mutation requirements
For mutations, you must include error handling fields userErrors { field message }
in your selection. If the userErrors
field is not empty, the action will fail and the workflow will stop.
Example:
mutation returnClose($id: ID!) {
returnClose(id: $id) {
return {
# Return fields
}
userErrors {
field
message
}
}
}
Output
The action returns the complete response from the GraphQL API as a JSON string in the data
property. You can parse this string using the Run code action. The parsed values can then be referenced in subsequent workflow steps using standard variable syntax.