> For the complete documentation index, see [llms.txt](https://learn.mechanic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.mechanic.dev/app/liquid-console.md).

# Liquid console

Test Mechanic Liquid code in a live scratchpad — experiment with filters, inspect event data, and debug task logic without creating a task.

The **Liquid console** is a scratchpad for testing [Mechanic Liquid](/platform/liquid.md) code. It's available in the footer of every page of the Mechanic app — look for it at the bottom of the screen.

Type any Liquid code and the console runs it after you edit, showing the output after a short delay. This is useful for experimenting with filters, testing snippets from a task, or inspecting data available for a specific event. Use **Reset** to clear your scratchpad, **Documentation** to open the Liquid docs, or **Ask Mechanic** when you want help using the console.

{% hint style="info" %}
Most Mechanic users don't need the Liquid console day-to-day. It's mainly useful when writing or debugging task code, or when support asks you to inspect event data.
{% endhint %}

<figure><img src="https://3145272362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQrnkixbmVHvKHMwAbm%2Fuploads%2Fgit-blob-a7ae82699cb3126cfa0eabf54931b0732100f8d4%2Fliquid_console_mechanic.jpg?alt=media" alt="The Liquid console with a sample Liquid expression and its output"><figcaption></figcaption></figure>

{% hint style="info" %}
The console can make Shopify Admin API requests (up to 10 per submission), which [task previews](/core/tasks/previews.md) cannot. However, it has tighter memory limits than actual task runs. If you reach a limit, try testing your code in a task subscribing to mechanic/user/trigger instead.
{% endhint %}

## Inspecting event data

When viewing a specific event in the Mechanic app, the console has access to that event's data — the same variables your tasks had when they processed it. This makes it a useful debugging tool.

For example, on a shopify/orders/create event page, you could use `{% log order.line_items[0] %}` to inspect the contents of an order's first line item.

![Using the Liquid console to inspect an order's line items on an event page](https://3145272362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQrnkixbmVHvKHMwAbm%2Fuploads%2Fgit-blob-0f0a5629048fae05d6e900c039c82a89598690a4%2F2022-05-18%2017.48.01.gif?alt=media)

{% hint style="info" %}
Looking at a child event? Try using `{% log event.parent %}` in the console to inspect data available from the parent. Or, to examine data from an ancestor event further back, try `{% log event.parent.parent %}`.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://learn.mechanic.dev/app/liquid-console.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
