Unify Logo Footer.svg
Unify Automations
Logo
Create LogQL Query

Create LogQL Query

Logo

3 mins READ

Create LogQL Query builds a valid LogQL query string from workflow, execution, or node identifiers, so you can target specific automation runs in the workflow-log store without writing LogQL syntax by hand. The resulting query is passed directly to Execute LogQL Query in the next step.

Overview

LogQL is the query language used to search the workflow-log store — the store that holds execution logs and variables for automation runs. Writing LogQL from scratch requires knowing the exact label selectors and log-stream structure. Create LogQL Query removes that barrier: supply one or more identifiers (workflow, execution, node) and the action assembles a correctly scoped query for you.

Screenshot 2026-08-27 at 17.11.40 1.png
Screenshot 2026-08-27 at 17.11.40 1.png

This action is almost always the first step in a two-node pattern: Create LogQL Query followed by Execute LogQL Query. You would rarely write LogQL by hand; instead, let this node generate the query from the identifiers available in your workflow context, then pass its output directly to Execute LogQL Query to retrieve the matching log entries.

LogQL is not SQL: LogQL queries the workflow-log store — execution logs and variables — not your business or reporting data. For business data, use the SQL actions instead.

Input

Field

Description

Required

Workflow ID

The identifier of the workflow whose logs you want to query. Scopes the query to all execution runs of this workflow.

Execution ID

The identifier of a specific execution run. Narrows the query to a single run rather than all runs of the workflow.

Node ID

The identifier of a specific node within the execution. Further narrows the query to logs produced by that node alone.

At least one identifier must be provided. Supplying multiple identifiers produces a more targeted query — for example, pairing a Workflow ID and Execution ID scopes the query to a single run of that workflow.

Output

The action returns a LogQL query string ready to be passed to Execute LogQL Query:

  • LogQL query string containing the label selectors and stream matchers derived from the identifiers you provided.

This string is the sole output — it is not a result set. Pass it to Execute LogQL Query to retrieve actual log entries.

Notes

Keep the following in mind when using Create LogQL Query.

  • This action generates a query; it does not execute one. Always pair it with Execute LogQL Query to retrieve log data.

  • LogQL targets the workflow-log store — execution logs and variables — not the analytics and reporting store. It is the observability layer, not the business data layer.

  • The more identifiers you supply, the more targeted the generated query. A Workflow ID alone matches all runs; adding an Execution ID pins it to a single run; adding a Node ID further narrows to one node's output within that run.

  • Identifiers are typically available as outputs from trigger or context nodes in the same automation — you do not usually hardcode them.

  • If none of the optional identifiers are provided, the node cannot build a meaningful query — always supply at least one.

The generated LogQL string is opaque to downstream nodes other than Execute LogQL Query. Treat it as a pass-through value and do not attempt to parse or modify it manually.

FAQs

Do I need all three identifiers?

No. Supply whichever identifiers you have. A Workflow ID alone produces a query scoped to all runs of that workflow. Each additional identifier narrows the scope further. Providing all three gives you the most precise query targeting a single node in a single execution

Can I write a LogQL query by hand and skip this node?

Yes. If you already have a valid LogQL string, you can supply it directly to Execute LogQL Query without using Create LogQL Query. This node exists to make query construction easier for most cases where you have IDs but not LogQL expertise.

Why can't I just use SQL to query workflow logs?

SQL queries the analytics and reporting store. Workflow execution logs live in a separate log store and are accessed via LogQL. The two stores are not interchangeable — use the SQL actions for business data and the LogQL actions for execution logs