# Techniques

- [Preventing action loops](https://learn.mechanic.dev/techniques/preventing-action-loops.md): Prevent infinite loops in Mechanic tasks — guard against re-triggers when a task modifies the same Shopify resource it subscribes to.
- [Writing a high-quality task](https://learn.mechanic.dev/techniques/writing-a-high-quality-task.md): Best practices for writing Mechanic tasks — previews, action loop prevention, logging, error handling, and test mode patterns.
- [Tagging Shopify resources](https://learn.mechanic.dev/techniques/tagging-shopify-resources.md): Auto-tag Shopify orders, customers, and products using Mechanic tasks — add or remove tags via the GraphQL Admin API.
- [Include metafields in Shopify webhook events](https://learn.mechanic.dev/techniques/include-metafields-in-shopify-webhook-events.md): Include Shopify metafields in webhook event payloads, and optionally filter by metafield values, using Mechanic custom Shopify webhooks.
- [Subscribe to Shopify metaobject events](https://learn.mechanic.dev/techniques/subscribe-to-shopify-metaobject-events.md): Subscribe Mechanic tasks to Shopify metaobject create, update, and delete events.
- [Batch processing of events](https://learn.mechanic.dev/techniques/batch-processing-of-events.md): Replace high-frequency Shopify webhook subscriptions with scheduled GraphQL scans to reduce queue volume and improve reliability.
- [Debouncing events](https://learn.mechanic.dev/techniques/debouncing-events.md): Debounce high-frequency Shopify webhook events in Mechanic using event filters and the cache to avoid duplicate processing.
- [Responding to action results](https://learn.mechanic.dev/techniques/responding-to-action-results.md): React to Mechanic action results using mechanic/actions/perform — build multi-step workflows that inspect HTTP responses, mutation results, and more.
- [Working with external APIs](https://learn.mechanic.dev/techniques/working-with-external-apis.md): Connect Mechanic to external REST and JSON APIs — load data via HTTP requests, receive data via webhooks, and integrate Shopify with any service.
- [JSON Web Signatures](https://learn.mechanic.dev/techniques/working-with-external-apis/json-web-signatures.md)
- [AWS request signatures](https://learn.mechanic.dev/techniques/working-with-external-apis/aws-request-signatures.md)
- [Finding a resource ID](https://learn.mechanic.dev/techniques/finding-a-resource-id.md)
- [Migrating templates from Shopify to Mechanic](https://learn.mechanic.dev/techniques/migrating-templates-from-shopify-to-mechanic.md): Migrate Shopify notification templates to Mechanic for custom order emails, PDF invoices, and on-demand transactional messages.
- [Securing Mechanic webhooks](https://learn.mechanic.dev/techniques/securing-mechanic-webhooks.md): Secure Mechanic webhooks with HMAC signatures and replay prevention — protect webhook endpoints used in online store forms.
- [Monitoring Mechanic](https://learn.mechanic.dev/techniques/monitoring.md): Monitor Mechanic task health and platform status — set up alerts, track queue delays, and diagnose Shopify webhook delivery issues.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.mechanic.dev/techniques.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
