[Integrations](https://spiral.ai/integrations) › [n8n](https://spiral.ai/integrations/n8n) › [GLM 5.2 (batch)](https://spiral.ai/integrations/n8n/glm-5-2-batch)

# How to Use GLM 5.2 (batch) in n8n

Use GLM 5.2 for complex debugging, code migrations, and research that needs substantial context. It expands on GLM 5.1 with a 1M-token context for sustained work across large projects.

|  |  |
| --- | --- |
| Model | GLM 5.2 (batch) |
| Available through | OpenRouter |
| Category | LLM |
| Price | Up to $0.005282 per run at the default inputs. $0.4186 per 1M input tokens, $1.2857 per 1M output tokens. |
| Returns | text, json |
| Runs | In the background |
| Setup | About 2 minutes, with a Spiral API key |

## Prompts to try with GLM 5.2 (batch) in n8n

- Every morning, use GLM 5.2 to compare newly collected incident reports with the previous seven days. Summarize recurring symptoms, new patterns, and questions that need investigation, citing report identifiers.
- Each Friday, use GLM 5.2 to synthesize this week's collected research excerpts. Group findings by topic, identify contradictions, and link each conclusion to its source.
- Each day, use GLM 5.2 to extract issues from newly received customer feedback text into JSON. Include the issue category, supporting excerpt, and source identifier; leave unsupported values empty.
- Each week, use GLM 5.2 to compare the collected project updates with the recorded requirements. Report changed assumptions, unresolved dependencies, and decisions that need attention.
- Every Monday, use GLM 5.2 to review newly collected API release notes against our recorded integration requirements. Produce a migration assessment with affected behavior and proposed verification checks.

## How to set up GLM 5.2 (batch) in n8n

Pick the way that suits you. Each takes about two minutes.

### Use the Spiral skill

1. **Send n8n this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use Spiral's MCP server

1. **Create a key**: Create a key under API keys in the console.

2. **Add an MCP Client node**: In a workflow, add an MCP Client node (or, under an AI Agent node, an MCP Client Tool) and set:

```text
https://api.spiral.ai/mcp
```

3. **Pick a tool**: The node lists Spiral's tools. In an MCP Client node pick one, such as `run`, and give it its arguments:

```json
{
  "provider": "fal",
  "model": "fal-ai/flux/schnell",
  "input": { "prompt": "a lighthouse at dawn" },
  "wait": true
}
```

4. **Run GLM 5.2 (batch) in a workflow step**: Give the step an instruction like the ones below and run it on your trigger or schedule. Spiral finds GLM 5.2 (batch), prices it and runs it each time the step fires.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run GLM 5.2 (batch)**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "openrouter",
    "model": "z-ai/glm-5.2:batch",
    "input": {
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    }
  }'
```

Then paste one of the prompts above: n8n finds GLM 5.2 (batch) on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/n8n

## GLM 5.2 (batch) tools and prices

- [Z.ai: GLM 5.2 (batch)](https://spiral.ai/tools/openrouter/z-ai/glm-5.2%3Abatch) (OpenRouter): Up to $0.005282 per run at the default inputs. $0.4186 per 1M input tokens, $1.2857 per 1M output tokens.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| seed |  | — |  |
| stop |  | — |  |
| min_p | 0 to 1 | — |  |
| tools |  | — |  |
| top_k | 0 to … | — |  |
| top_p | 0 to 1 | — |  |

## What can you do with GLM 5.2 (batch) in n8n?

GLM 5.2 can compare recurring batches of text with accumulated background and produce a consistent review. Define the comparison period, evidence requirements, and report structure for each run.

### Repository architecture review

Map module responsibilities, dependencies, and API boundaries before planning a change to a large codebase.

### API and SDK migrations

Plan and implement changes across callers, adapters, and tests while preserving specified behavior.

### Complex bug investigations

Compare code, logs, and failure reports to develop a testable explanation and a targeted fix.

### Performance optimization

Use profiling evidence to propose changes, run comparisons, and report whether the measured bottleneck improved.

### Research synthesis

Compare lengthy source material, identify disagreements, and produce a brief with evidence for each conclusion.

### Structured document extraction

Turn supplied text into JSON records with consistent categories, supporting excerpts, and explicit missing values.

## Overview

- [OpenRouter](https://spiral.ai/providers/openrouter)
- [All n8n guides](https://spiral.ai/integrations/n8n)

## GLM 5.2 (batch) in other agents

- [Amp](https://spiral.ai/integrations/amp/glm-5-2-batch)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/glm-5-2-batch)
- [Claude](https://spiral.ai/integrations/claude-desktop/glm-5-2-batch)
- [Claude Code](https://spiral.ai/integrations/claude-code/glm-5-2-batch)
- [Cline](https://spiral.ai/integrations/cline/glm-5-2-batch)
- [Codex](https://spiral.ai/integrations/codex/glm-5-2-batch)
- [Cursor](https://spiral.ai/integrations/cursor/glm-5-2-batch)
- [Devin](https://spiral.ai/integrations/devin/glm-5-2-batch)
- [dots](https://spiral.ai/integrations/dots/glm-5-2-batch)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/glm-5-2-batch)
- [Gemini](https://spiral.ai/integrations/gemini/glm-5-2-batch)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/glm-5-2-batch)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/glm-5-2-batch)
- [goose](https://spiral.ai/integrations/goose/glm-5-2-batch)
- [Grok](https://spiral.ai/integrations/grok/glm-5-2-batch)
- [Grok Build](https://spiral.ai/integrations/grok-build/glm-5-2-batch)
- [Hermes](https://spiral.ai/integrations/hermes/glm-5-2-batch)
- [Instinct](https://spiral.ai/integrations/instinct/glm-5-2-batch)
- [Manus](https://spiral.ai/integrations/manus/glm-5-2-batch)
- [Muse](https://spiral.ai/integrations/muse/glm-5-2-batch)
- [Muse Code](https://spiral.ai/integrations/muse-code/glm-5-2-batch)
- [Notion](https://spiral.ai/integrations/notion/glm-5-2-batch)
- [OpenClaw](https://spiral.ai/integrations/openclaw/glm-5-2-batch)
- [opencode](https://spiral.ai/integrations/opencode/glm-5-2-batch)
- [Perplexity](https://spiral.ai/integrations/perplexity/glm-5-2-batch)
- [Raycast](https://spiral.ai/integrations/raycast/glm-5-2-batch)
- [VS Code](https://spiral.ai/integrations/vscode/glm-5-2-batch)
- [Windsurf](https://spiral.ai/integrations/windsurf/glm-5-2-batch)
- [Zapier](https://spiral.ai/integrations/zapier/glm-5-2-batch)

## More n8n guides

- [GLM 4.7 Flash](https://spiral.ai/integrations/n8n/glm-4-7-flash)
- [GLM 5.3 Flash](https://spiral.ai/integrations/n8n/glm-5-3-flash)
- [GLM 4.5 Air](https://spiral.ai/integrations/n8n/glm-4-5-air)
- [GLM 5.3 FlashX](https://spiral.ai/integrations/n8n/glm-5-3-flashx)
- [Fugu Ultra v2](https://spiral.ai/integrations/n8n/fugu-ultra-v2)
- [GLM 5.3 FlashX Legal](https://spiral.ai/integrations/n8n/glm-5-3-flashx-legal)

## Questions about GLM 5.2 (batch) in n8n

**Can n8n use GLM 5.2 (batch)?**

Yes. Add Spiral to n8n as an MCP server, and n8n can find and run GLM 5.2 (batch) like any built-in tool.

**How much does GLM 5.2 (batch) cost in n8n?**

Up to $0.005282 per run at the default inputs. $0.4186 per 1M input tokens, $1.2857 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your n8n plan is separate.

**Do I need an OpenRouter account to use GLM 5.2 (batch) in n8n?**

You need no OpenRouter account. n8n uses one Spiral API key for every tool, and Spiral runs GLM 5.2 (batch) on its own OpenRouter account.

**How long does it take to set up GLM 5.2 (batch) in n8n?**

About two minutes: create a key, then add an MCP Client node, then pick a tool.

**Does n8n wait while GLM 5.2 (batch) runs?**

GLM 5.2 (batch) runs in the background. n8n starts the run, checks on it and gives you the text, json when it's ready.

**What is GLM 5.2 good at?**

GLM 5.2 is suited to engineering tasks that require keeping substantial context across multiple steps, including debugging, migrations, and performance work. It also fits long-document analysis and research synthesis.

**How much context and output can GLM 5.2 handle?**

Z.ai documents a 1M-token context window and a separate maximum output of 128K tokens. Treat those as the maker's published limits when planning a large task.

**Can GLM 5.2 return JSON?**

Yes, Z.ai documents structured output support, including JSON. Specify the expected structure and how to represent missing information.

**When should I increase thinking effort?**

Consider greater thinking effort for difficult debugging or engineering decisions. Z.ai describes effort control as a tradeoff between coding performance and latency; compare results on a representative task.

**Where does GLM 5.2 still fall short?**

Extended engineering work remains a limitation: Z.ai reports that GLM 5.2 trails Claude Opus 4.8 on SWE-Marathon. For a long implementation, request intermediate checks and explicit verification results.

