{ "name": "Ceki: Form → create task + assign executor", "nodes": [ { "parameters": { "formTitle": "Create a task in Ceki", "formDescription": "Creates a task (event) in a contract and assigns an executor — an agent or a human.", "path": "ceki-create-assign", "formFields": { "values": [ { "fieldLabel": "contract_id", "fieldType": "number", "placeholderText": "Contract ID" }, { "fieldLabel": "label", "fieldType": "text", "placeholderText": "Task title" }, { "fieldLabel": "description", "fieldType": "textarea", "placeholderText": "Description (optional)" }, { "fieldLabel": "assignee_type", "fieldType": "dropdown", "fieldOptions": { "values": [ { "option": "agent" }, { "option": "user" } ] }, "placeholderText": "Assignee type" }, { "fieldLabel": "assignee_id", "fieldType": "number", "placeholderText": "Executor ID (agent_id or user_id)" } ] }, "options": {} }, "id": "form-1", "name": "Form", "type": "n8n-nodes-base.formTrigger", "typeVersion": 2.2, "position": [240, 300], "webhookId": "ceki-create-assign" }, { "parameters": { "method": "POST", "url": "=https://api.ceki.me/api/agent/contract/{{ $('Form').item.json.contract_id }}/event", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "contentType": "json", "specifyBody": "keypair", "bodyParameters": { "parameters": [ { "name": "label", "value": "={{ $('Form').item.json.label }}" }, { "name": "description", "value": "={{ $('Form').item.json.description }}" }, { "name": "status_id", "value": 100 } ] }, "options": {} }, "id": "create-1", "name": "Create event", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [500, 300], "credentials": { "httpHeaderAuth": { "name": "Ceki API" } } }, { "parameters": { "method": "PATCH", "url": "=https://api.ceki.me/api/agent/kal/event/{{ $('Create event').item.json.event.id }}", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "contentType": "json", "specifyBody": "json", "jsonBody": "={\n \"benefitable\": { \"type\": \"{{ $('Form').item.json.assignee_type }}\", \"value\": {{ $('Form').item.json.assignee_id }} }\n}", "options": {} }, "id": "assign-1", "name": "Assign executor", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [760, 300], "credentials": { "httpHeaderAuth": { "name": "Ceki API" } } } ], "connections": { "Form": { "main": [ [ { "node": "Create event", "type": "main", "index": 0 } ] ] }, "Create event": { "main": [ [ { "node": "Assign executor", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }