{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/schemas/serverlessFunction.schema.json", "title": "Twenty Serverless Function Manifest", "description": "Schema for Twenty AI serverless function configuration files", "type": "object", "required": [ "universalIdentifier", "name" ], "properties": { "$schema": { "type": "string", "description": "JSON Schema reference for validation and IDE support" }, "universalIdentifier": { "type": "string", "description": "Unique identifier (UUID format recommended)", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" }, "name": { "type": "string", "description": "Name singular for the serverless function", "pattern": "^[a-zA-Z][a-zA-Z0-9]*$", "minLength": 1, "maxLength": 100 }, "description": { "type": "string", "description": "Brief description of the serverless function", "maxLength": 500 }, "timeoutSeconds": { "type": "number", "description": "Serverless function timeout in seconds, between 1 and 900", "min": 1, "max": 900 }, "triggers": { "type": "array", "description": "Serverless function's triggers", "items": { "anyOf": [ { "$ref": "https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/schemas/trigger.schema.json" }, { "type": "object", "required": ["$ref"], "properties": { "$ref": { "type": "string" } }, "additionalProperties": false } ] } }, "code": { "type": "object", "description": "Serverless function's code", "required": ["src"], "properties": { "src": { "type": "object", "description":"Serverless function source folder", "required": ["index.ts"], "properties": { "index.ts": { "type": "string", "description":"Serverless function index.ts file" }, "additionalProperties": true } } }, "additionalProperties": false } }, "additionalProperties": false, "examples": [ { "standardId": "550e8400-e29b-41d4-a716-446655440001", "universalIdentifier": "550e8400-e29b-41d4-a716-446655440001", "name": "My serverless function", "triggers": [ { "standardId": "550e8400-e29b-41d4-a716-446655440002", "universalIdentifier": "550e8400-e29b-41d4-a716-446655440002", "type": "cron", "schedule": "0 9 * * *" }, { "standardId": "550e8400-e29b-41d4-a716-446655440003", "universalIdentifier": "550e8400-e29b-41d4-a716-446655440003", "type": "databaseEvent", "eventName": "company.created" }, { "standardId": "550e8400-e29b-41d4-a716-446655440004", "universalIdentifier": "550e8400-e29b-41d4-a716-446655440004", "type": "route", "path": "test-route", "httpMethod": "GET", "isAuthRequired": false } ], "code": { "src": { "index.ts": "{\n \"code\": \"import axios from 'axios';\\n\\nexport const main = async (params) => {\\n const { a, b } = params;\\n const message = \\\"toto\\\";\\n return { message };\\n};\",\n \"params\": { \"a\": \"1\", \"b\": 2 }\n}\n" } } } ] }