Skip to main content
Glama

set_node_position

Position nodes within n8n workflows by specifying exact coordinates to organize workflow layouts and improve visual structure.

Instructions

Set the position of a node in an n8n workflow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYes
workflowIdYes
xYes
yYes

Implementation Reference

  • Core handler function that updates the node position in the workflow by fetching the current workflow, modifying the node's position array, and saving via optimistic concurrency with ETag.
    async setNodePosition(request: SetNodePositionRequest): Promise<SetNodePositionResponse> { await this.performWorkflowUpdate(request.workflowId, (workflow) => { const nodeIndex = workflow.nodes.findIndex((node) => node.id === request.nodeId); if (nodeIndex === -1) { throw new Error(`Node with id ${request.nodeId} not found in workflow ${request.workflowId}`); } workflow.nodes[nodeIndex].position = [request.x, request.y]; }); return { ok: true }; }
  • MCP server handler that delegates to N8nClient.setNodePosition and formats the JSON response.
    private async handleSetNodePosition(args: SetNodePositionRequest) { const result = await this.n8nClient.setNodePosition(args); return { content: [ { type: 'text', text: JSON.stringify(jsonSuccess(result), null, 2), }, ], };
  • src/index.ts:215-215 (registration)
    Tool registration in listTools response, defining name, description, and input schema.
    { name: 'set_node_position', description: 'Set the position of a node in an n8n workflow', inputSchema: { type: 'object', properties: { workflowId: { oneOf: [{ type: 'string' }, { type: 'number' }] }, nodeId: { type: 'string' }, x: { type: 'number' }, y: { type: 'number' } }, required: ['workflowId', 'nodeId', 'x', 'y'] } },
  • TypeScript interfaces defining the request and response shapes for set_node_position.
    export interface SetNodePositionRequest { workflowId: string | number; nodeId: string; x: number; y: number; } export interface SetNodePositionResponse { ok: true; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/get2knowio/n8n-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server