cospec

n8n community nodes for coSPEC - AI coding agent runs

Package Information

Downloads: 78 weekly / 78 monthly
Latest Version: 0.1.0
Author: coSPEC

Documentation

n8n-nodes-cospec

This is an n8n community node. It lets you use coSPEC in your n8n workflows.

coSPEC lets you run AI coding agents securely on your repositories. Connect your repo, send a prompt, get PRs, branches, and fixes back. This node brings coSPEC into your n8n workflows.

n8n is a fair-code licensed workflow automation platform.

Installation |
Operations |
Credentials |
Compatibility |
Usage |
Resources

Installation

Follow the installation guide in the n8n community nodes documentation.

Operations

coSPEC (Action Node)

Operation Description
Create Run Create an AI agent run on a GitHub repository. Optionally polls until completion.
Get Run Fetch run details by ID, including status, outputs, and usage.

Create Run parameters:

  • Repository — GitHub repo in owner/repo format
  • Prompt — Instruction for the AI agent (supports n8n expressions)
  • Template — Sandbox template (dynamically loaded from your account)
  • Model — Claude model: Sonnet, Opus, or Haiku
  • Branch — Git branch to clone (optional, defaults to repo default)
  • Wait for Completion — Poll until the run finishes (default: true)
  • Guardrails — Timeout, max turns, max cost limits
  • Environment Variables — Key-value pairs passed to the sandbox
  • Metadata — Key-value pairs echoed back in webhook callbacks (for cross-workflow correlation)

coSPEC Trigger

Starts a workflow when an agent run completes, fails, or is cancelled. Uses webhooks — no polling.

Event Description
Run Completed Agent finished successfully
Run Failed Agent hit an error, limit, or timeout
Run Cancelled Run was cancelled

Output Fields

Both nodes output the run object with grouped output fields:

Field Example
status completed, failed, cancelled
failReason null, error, max_turns, max_cost, timeout
pr.url https://github.com/owner/repo/pull/42
pr.title Fix login validation bug
pr.number 42
issue.url https://github.com/owner/repo/issues/10
issue.title Login bug
issue.number 10
branch.name fix/login-bug
summary First text output content
usage.totalCostUsd 1.23
metadata Key-value pairs from the request (or null)
outputs Raw outputs array (for advanced use)

Grouped fields (pr, issue, branch) are objects when present, null when absent.

Credentials

  1. Sign up at cospec.io
  2. Go to Dashboard → API Keys and create a new key
  3. In n8n, add a coSPEC API credential and paste your key (starts with csk_live_...)

The credential test verifies your API key automatically.

Compatibility

  • Tested with n8n v1.91+
  • Requires Node.js 22+

Usage

Basic: Create a Run and Wait

  1. Add a Manual Trigger node
  2. Add a coSPEC node → operation Create Run
  3. Set your repository, prompt, and template
  4. Execute — the node polls until the agent finishes and returns the result

Fire and Forget

Set Wait for Completion to false. The node returns immediately with the run ID. Use Get Run later to check the status.

Webhook Trigger

  1. Add a coSPEC Trigger node to a new workflow
  2. Select which events to listen for
  3. Activate the workflow — a webhook is registered with the coSPEC API
  4. When a run finishes, the workflow starts automatically

Note: The trigger requires a publicly accessible HTTPS URL. It works on n8n Cloud out of the box. For local/self-hosted n8n, use a tunnel (e.g. cloudflared tunnel --url http://localhost:5678) or use the Create Run action node with Wait for Completion enabled instead.

AI Agent Tool

Both nodes have usableAsTool enabled. You can use them as tools in n8n's AI agent workflows — let an AI assistant create and monitor coding agent runs.

Resources

Discussion