{ "kind": "open-flow-workflow", "version": 1, "name": "Freshdesk Ticket Creator", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_c70553f2c59135c0": { "name": "Enter ticket details", "kind": "start", "inputDefs": [ { "jsonSchema": { "type": "string", "format": "email", "minLength": 1 }, "nullable": false, "handle": "email" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "subject" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "description" } ] }, "n_a863f73d3ecfbd94": { "inputs": { "email": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c70553f2c59135c0", "output": "email" } ] }, "subject": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c70553f2c59135c0", "output": "subject" } ] }, "description": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c70553f2c59135c0", "output": "description" } ] } }, "name": "Prepare Freshdesk ticket", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string", "format": "email", "minLength": 1 }, "nullable": false, "handle": "email" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "subject" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "description" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "endpoint" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "body" } ], "name": "Prepare Freshdesk ticket", "moduleId": "n_8cc40dfa67730774", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_db4bc7842370ffdf": { "inputs": { "endpoint": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_a863f73d3ecfbd94", "output": "endpoint" } ] }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_a863f73d3ecfbd94", "output": "body" } ] } }, "name": "Create Freshdesk ticket", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "endpoint" }, { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" }, { "jsonSchema": { "const": "base64" }, "nullable": true, "handle": "bodyEncoding" } ], "name": "Create Freshdesk ticket", "executor": { "providerId": "freshdesk", "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "kind": "connector-proxy" } } }, "n_ffaf214d1a0d47fe": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_db4bc7842370ffdf", "output": "body" } ] }, "statusCode": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_db4bc7842370ffdf", "output": "statusCode" } ] }, "bodyEncoding": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_db4bc7842370ffdf", "output": "bodyEncoding" } ] } }, "name": "Confirm created ticket", "kind": "task", "task": { "inputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "const": "base64" }, "nullable": true, "handle": "bodyEncoding" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "integer", "minimum": 1 } }, "required": [ "id" ], "additionalProperties": true }, "nullable": false, "handle": "ticket" } ], "name": "Confirm created ticket", "moduleId": "n_a564e7fa96ecf6e8", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_ad853c7a2ead9299": { "name": "Created Freshdesk ticket", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "integer", "minimum": 1 } }, "required": [ "id" ], "additionalProperties": true }, "nullable": false, "handle": "ticket" } ], "outputMappings": { "ticket": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_ffaf214d1a0d47fe", "output": "ticket" } ] } } } }, "edges": [ { "source": "n_c70553f2c59135c0", "target": "n_a863f73d3ecfbd94" }, { "source": "n_a863f73d3ecfbd94", "target": "n_db4bc7842370ffdf" }, { "source": "n_db4bc7842370ffdf", "target": "n_ffaf214d1a0d47fe" }, { "source": "n_ffaf214d1a0d47fe", "target": "n_ad853c7a2ead9299" } ] } }, "modules": { "n_8cc40dfa67730774": { "name": "Prepare Freshdesk ticket", "imports": [], "source": "export default function ticketRequest({ email, subject, description }) {\n if ([email, subject, description].some((value) => typeof value !== 'string' || !value)) throw new Error('Configure the requester email, subject and description');\n return { endpoint: '/api/v2/tickets', body: { email, subject, description, status: 2, priority: 1, source: 2 } };\n}\n" }, "n_a564e7fa96ecf6e8": { "name": "Confirm created ticket", "imports": [], "source": "export default function ticketResult({ body, statusCode, bodyEncoding }) {\n if (statusCode !== 201 || bodyEncoding != null || !body || typeof body !== 'object' || Array.isArray(body) || !Number.isSafeInteger(body.id) || body.id <= 0) throw new Error('Freshdesk did not return a completed ticket creation record');\n return { ticket: body };\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }