Flow Automation: Finding Metaobjects via Action
You can use the Find metaobjects action in Flow Automation to retrieve multiple metaobject entries based on conditions such as metaobject type, creation time, and update time, then use the results in subsequent workflow actions.
Metaobjects let you manage custom content in your store, such as designer profiles or customer reviews. Each metaobject can contain multiple entries, with each entry storing a specific piece of content. For more information, refer to "Customizing Your Store Content with Metaobject."
This guide explains when to use the action, its query fields, supported workflow triggers, and how to test and use it in a practical scenario.
When to Use the Find Metaobjects Action
You can use the Find metaobjects action in the following scenarios:
- Follow up on draft content: Regularly retrieve metaobject entries, identify those still in draft, and remind the relevant team members to follow up.
- Review new or updated content: Retrieve entries created or updated within a specific time range to review their content.
- Process multiple entries: Retrieve a list of metaobject entries that match your query conditions and process each one using subsequent workflow actions.
Field Descriptions
The Find metaobjects action lets you filter metaobject entries using query conditions and specify how many results to retain.
| Field | Description |
| Query conditions |
Specify which metaobject entries to retrieve. Click + Add condition, select one or more conditions, and click Sure. Then enter a value for each condition or click + Add variable to reference a parameter from a previous workflow step. The following query conditions are supported:
|
| The quantity to keep in the query result (Optional) | Specifies the maximum number of entries to retain, up to 100. Enter a number directly or click + Add variable to reference a parameter from a previous workflow step. |
|
Notes:
|
Applicable Workflows
The Find metaobjects action is primarily used in workflows initiated by the following trigger:
- [General] Scheduled time
| Note: For detailed instructions on configuring this trigger, refer to "Flow Automation: Scheduled Trigger." |
Testing the Workflow
To verify that your workflow successfully retrieves metaobject entries, follow these steps:
-
In your SHOPLINE Admin, go to Content > Metaobjects. Make sure you have at least one metaobject entry and note its metaobject type.
- In Flow Automation, create a workflow using the Scheduled time trigger and the Find metaobjects action. Configure the following settings:
- Scheduled time: Set First trigger time to a few minutes from now and Repeat or not to Not repeating.
- Find metaobjects: Add the type query condition and enter the metaobject type you noted in Step 1.
- After configuring the workflow, click Publish.
-
Once the scheduled trigger time has passed, return to Flow Automation and check the workflow execution results.
Note: For more information on monitoring workflow executions, refer to the "How to View the Running of a Flow" section in the "Introduction to Flow Automation" guide. - In the execution results, confirm that the Find metaobjects action successfully returned the entries of the specified metaobject type.
Example Use Case
The following example demonstrates how to use the Find metaobjects action to automatically remind your operations team to follow up on unpublished metaobject entries.
Scenario: Your store uses a metaobject of type designer to manage designer profiles. Every Friday at 16:00, the workflow retrieves entries of this type and sends a separate email reminder for each draft entry, prompting your operations team to complete and publish it.
Configure the workflow as follows:
-
Trigger: Scheduled time
- First trigger time: This Friday at 16:00
- Repeat or not: Repeat weekly
-
Action: Find metaobjects
- Query conditions: type = designer
- The quantity to keep in the query result: 100
- Action: For each loop (iterate) (repeats the following steps for each retrieved entry)
- Condition: [Entry Status] equals Draft (checks whether the entry is still in draft)
-
Action: Send email
- Subject: Designer Draft Pending: [Entry handle]
- Content: The designer entry "[Entry handle]" is still in draft (last updated: [Updated at]). Please go to Content > Metaobjects in your SHOPLINE Admin to complete and publish it.
- Recipient: Your operations team's email address
Outcome: Every Friday, your operations team receives a separate email reminder for each draft entry found, helping them track pending designer profiles and prevent content from remaining in draft for too long.
|
Notes:
|
Usage Limits & Notes
When using the Find metaobjects action, keep the following in mind:
- Query only: This action only retrieves metaobject entry data and does not modify entries. To perform additional operations based on the query results, add the corresponding actions to your workflow.
- Result limit: You can retain up to 100 entries per query. If more entries match your conditions, add additional query conditions, such as metaobject type or creation time, to narrow the results.
- No direct status filter: Entry status cannot be used as a query condition. To process only draft entries, add a condition in a subsequent workflow step to check whether the entry status is Draft.
- No matching results: If no entries match your query conditions, the action returns an empty result.