n8n-example-workflow.json•4.49 kB
{
"name": "Human Design Calculator",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "human-design",
"responseMode": "responseNode",
"options": {}
},
"id": "webhook-trigger",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [240, 300],
"webhookId": "human-design-webhook"
},
{
"parameters": {
"jsCode": "// Get input data\nconst birthDate = $input.item.json.birthDate;\nconst birthTime = $input.item.json.birthTime;\nconst birthLocation = $input.item.json.birthLocation || 'Москва, Россия';\n\n// Import Human Design calculation function\n// Note: In production, you should load this from a file or URL\nconst calculateHumanDesign = async ({ birthDate, birthTime, birthLocation }) => {\n // Simplified calculation for demo\n const birthDateObj = new Date(`${birthDate}T${birthTime}`);\n \n // Generate gates based on date\n const gates = [];\n const planets = ['Sun', 'Moon', 'Mercury', 'Venus', 'Mars', 'Jupiter', 'Saturn', 'Rahu', 'Ketu'];\n const seed = birthDateObj.getTime();\n \n planets.forEach((planet, index) => {\n const randomGate = ((seed % 64) + index * 7) % 64 + 1;\n gates.push({\n planet: planet,\n gate: randomGate,\n line: (Math.floor(seed / 1000) % 6) + 1,\n });\n });\n \n // Determine type (simplified)\n const hasManyGates = gates.length > 5;\n const types = [\n { name: 'Generator', description: 'Генератор' },\n { name: 'Manifesting Generator', description: 'Манифестирующий Генератор' },\n { name: 'Projector', description: 'Проектор' },\n { name: 'Manifestor', description: 'Манифестор' },\n { name: 'Reflector', description: 'Рефлектор' },\n ];\n const type = types[Math.floor(seed % types.length)];\n \n // Determine strategy\n const strategies = {\n 'Manifestor': 'Информировать',\n 'Generator': 'Отвечать',\n 'Manifesting Generator': 'Отвечать и информировать',\n 'Projector': 'Ждать приглашения',\n 'Reflector': 'Ждать полного лунного цикла',\n };\n \n const strategy = strategies[type.name] || 'Отвечать';\n \n // Determine authority\n const authorities = [\n { name: 'Sacral', description: 'Сакральная авторитет' },\n { name: 'Emotional', description: 'Эмоциональная авторитет' },\n { name: 'Splenic', description: 'Селезеночная авторитет' },\n ];\n const authority = authorities[Math.floor(seed % authorities.length)];\n \n // Determine profile\n const sunLine = (Math.floor(seed / 86400000) % 6) + 1;\n const earthLine = 7 - sunLine;\n \n return {\n birthDate,\n birthTime,\n birthLocation,\n type,\n strategy,\n authority,\n profile: {\n number: `${sunLine}/${earthLine}`,\n description: `Профиль ${sunLine}/${earthLine}`,\n },\n gates,\n calculationNote: 'Это демо-расчет. Для точных результатов используйте полную версию MCP сервера.',\n };\n};\n\n// Calculate Human Design\nconst result = await calculateHumanDesign({\n birthDate,\n birthTime,\n birthLocation,\n});\n\nreturn {\n json: result,\n};"
},
"id": "calculate-hd",
"name": "Calculate Human Design",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [460, 300]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ $json }}"
},
"id": "respond-webhook",
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [680, 300]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Calculate Human Design",
"type": "main",
"index": 0
}
]
]
},
"Calculate Human Design": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"staticData": null,
"tags": [],
"triggerCount": 1,
"updatedAt": "2024-01-01T00:00:00.000Z",
"versionId": "1"
}