Manage Claude Code sessions from Matrix with YouTrack and GitLab
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (7)
- Edit Fields (Set)
n8n-nodes-base.set - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Switch
n8n-nodes-base.switch - SSH
n8n-nodes-base.ssh
What it does
Manage AI coding sessions from Matrix with YouTrack and GitLab Who is this for Development teams using Claude Code who want a chat-ops interface for project management. Instead of SSH-ing into a server to run Claude, your whole team interacts with it through a Matrix chat room — with issue tracking and CI/CD pipeline visibility built in. What it does - Polls a Matrix room every 30 seconds and routes commands to handlers - Forwards messages to Claude Code sessions via SSH, posts responses back - Manages multiple concurrent sessions — start, pause, resume, switch, end - Updates YouTrack issues directly from chat (change state, post comments, query status) - Fetches GitLab CI pipeline status and logs, retries failed pipelines - Reports server load and Claude process status - Tracks sessions in SQLite with lock-based concurrency and cooldown guards Template Image !Screenshot from 20260312 183201.png(fileId:4905) How it works The workflow polls a Matrix room for new messages. A command router parses !commands and dispatches them to the right handler: - Regular messages resume an active Claude Code session and post the response - !session — manage sessions (current, list, done, cancel, pause, resume, switch, log) - !issue — update YouTrack issues (status, info, start, stop, verify, done, close, comment) - !pipeline — fetch GitLab CI pipeline status and logs, retry failed pipelines - !system — report server load and running processes - !help — show command reference Requirements - Matrix homeserver with a bot account (E2EE must be disabled — n8n cannot decrypt Matrix messages) - YouTrack instance with API token - GitLab instance with API token - Linux server with Claude Code CLI installed, accessible via SSH - n8n self-hosted with SSH private key credentials configured > This is a self-hosted template. It requires your own infrastructure — > it will not run on n8n Cloud without a server accessible via SSH. How to set up 1. Import the workflow into n8n 2. Edit the Gateway Config Set node with your URLs and paths 3. Set YOUTRACKTOKEN and GITLABTOKEN as environment variables on your server (not in the workflow) 4. Create n8n credentials: SSH Private Key and HTTP Header Auth (Matrix bot token as Authorization: Bearer <token>) 5. Create the SQLite database on your server: sql CREATE TABLE sessions ( issueid TEXT PRIMARY KEY, issuetitle TEXT, sessionid TEXT, startedat TEXT, lastactive TEXT, messagecount INTEGER DEFAULT 0, paused INTEGER DEFAULT 0, iscurrent INTEGER DEFAULT 0 ); CREATE TABLE queue ( id INTEGER PRIMARY KEY AUTOINCREMENT, issueid TEXT, message TEXT, queuedat TEXT ); CREATE TABLE sessionlog ( id INTEGER PRIMARY KEY AUTOINCREMENT, issueid TEXT, issuetitle TEXT, sessionid TEXT, startedat TEXT, endedat TEXT, messagecount INTEGER, outcome TEXT ); 6. Activate the workflow How to customize - Add commands — add a case to the Command Router Switch node - Change polling interval — edit the Schedule Trigger node - Swap issue tracker — replace YouTrack API calls with Jira or Linear - Swap chat platform — replace Matrix HTTP nodes with Slack or Discord - Add pipeline detail — extend Handle Pipeline to fetch individual job logs