AI n8n Workflow and Credentials Manager

6b8cef55-0b6d-474d-8505-a8b3d513fd54

Latency
6406ms
Cost
$0.0020
Tokens
868
Status
success
gemini-3-flash-preview

Workflow Graph

Trace

[
  {
    "data": {
      "nodeType": "manualTrigger"
    },
    "event": "node_start",
    "nodeId": "382dddd4-da50-49fa-90a2-f7d6d160afdf",
    "timestamp": 1783205006033
  },
  {
    "data": {
      "initialData": {
        "id": "wf_12345",
        "name": "AI n8n Workflow and Credentials Manager",
        "nodes": [
          {
            "id": "trigger_node",
            "type": "trigger",
            "parameters": {
              "name": "Manual Trigger"
            }
          },
          {
            "id": "map_credentials_node",
            "type": "function",
            "parameters": {
              "code": "return {\n  'mapped_credentials': {\n    'openai_api_key': item.credentials.to_py.openai_api_key,\n    'n8n_api_key': item.credentials.to_py.n8n_api_key\n  }\n};"
            }
          },
          {
            "id": "save_to_db_node",
            "type": "set",
            "parameters": {
              "values": {
                "credentials_saved": true
              }
            }
          },
          {
            "id": "chat_trigger_node",
            "type": "openai",
            "parameters": {
              "model": "gpt-4o",
              "prompt": "Given the following workflow details and available credentials, generate a concise summary of the workflow's purpose and list the credentials it requires. Workflow ID: , Workflow Name: {{ $json.input.workflow_name }}. Available Credentials: {{ $json.input.credentials.to_py }}",
              "max_tokens": 250,
              "temperature": 0.7
            }
          },
          {
            "id": "toolcode_node",
            "type": "function",
            "parameters": {
              "code": "return {\n  'tool_code': 'def get_workflow_details(workflow_id):\n    # Placeholder for actual database query\n    return {\n        \"workflow_id\": workflow_id,\n        \"workflow_name\": \"AI n8n Workflow and Credentials Manager\",\n        \"description\": \"Manages n8n workflows and their associated credentials.\",\n        \"required_credentials\": [\"openai_api_key\", \"n8n_api_key\"]\n    }'\n};"
            }
          },
          {
            "id": "llm_node",
            "type": "openai",
            "parameters": {
              "model": "gpt-4o",
              "prompt": "You are an AI assistant for managing n8n workflows and credentials. Based on the provided workflow information and the output from a potential tool call, generate a structured JSON output containing the workflow ID, workflow name, a brief description, and a list of required credentials. \n\nWorkflow Info:  - \nTool Code Output (simulated): \n\nFormat the output as:\n{\n  \"workflow_id\": \"...\",\n  \"workflow_name\": \"...\",\n  \"description\": \"...\",\n  \"required_credentials\": [\"...\", \"...\"]\n}",
              "max_tokens": 300,
              "temperature": 0.5
            }
          },
          {
            "id": "window_buffer_memory_node",
            "type": "memory",
            "parameters": {
              "input_key": "user_input",
              "output_key": "ai_response",
              "memory_type": "window",
              "window_size": 5
            }
          },
          {
            "id": "n8n_node",
            "type": "http",
            "parameters": {
              "url": "https://your-n8n-instance.com/api/v1/workflows/",
              "method": "GET",
              "headers": {
                "Authorization": "Bearer "
              }
            }
          }
        ],
        "credentials": {
          "to_py": {
            "n8n_api_key": "n8n_your_api_key_here",
            "openai_api_key": "sk-your-openai-api-key-here"
          }
        },
        "workflow_id": "wf_ai_manager_001",
        "workflow_name": "AI n8n Workflow and Credentials Manager"
      }
    },
    "event": "triggered",
    "nodeId": "manualTrigger",
    "timestamp": 1783205006033
  },
  {
    "data": {
      "status": "ok",
      "nodeType": "manualTrigger"
    },
    "event": "node_end",
    "nodeId": "382dddd4-da50-49fa-90a2-f7d6d160afdf",
    "timestamp": 1783205006033
  },
  {
    "data": {
      "nodeType": "trigger"
    },
    "event": "node_start",
    "nodeId": "7e32cf83-0498-4666-8677-7fd32eec779c",
    "timestamp": 1783205006037
  },
  {
    "data": {
      "kind": "@n8n/n8n-nodes-langchain.chatTrigger"
    },
    "event": "seeded",
    "nodeId": "trigger",
    "timestamp": 1783205006037
  },
  {
    "data": {
      "status": "ok",
      "nodeType": "trigger"
    },
    "event": "node_end",
    "nodeId": "7e32cf83-0498-4666-8677-7fd32eec779c",
    "timestamp": 1783205006037
  },
  {
    "data": {
      "nodeType": "integration"
    },
    "event": "node_start",
    "nodeId": "8c37f2ae-192b-4f98-a6fa-5aabf870e9e0",
    "timestamp": 1783205006039
  },
  {
    "data": {
      "mode": "read",
      "status": "ok",
      "service": "toolcode",
      "latencyMs": 250,
      "operation": "run",
      "simulated": true
    },
    "event": "integration_mocked",
    "nodeId": "integration",
    "timestamp": 1783205006292
  },
  {
    "data": {
      "status": "ok",
      "nodeType": "integration"
    },
    "event": "node_end",
    "nodeId": "8c37f2ae-192b-4f98-a6fa-5aabf870e9e0",
    "timestamp": 1783205006292
  },
  {
    "data": {
      "nodeType": "llm"
    },
    "event": "node_start",
    "nodeId": "60b2ab16-dc7c-4cb8-a58f-696f721b8d6f",
    "timestamp": 1783205006297
  },
  {
    "data": {
      "messages": 1,
      "maxTokens": 1024
    },
    "event": "calling openai/gpt-4o-mini",
    "nodeId": "llm",
    "timestamp": 1783205006297
  },
  {
    "data": {
      "model": "gpt-4o-mini",
      "provider": "openai"
    },
    "event": "llm_call",
    "nodeId": "_context",
    "timestamp": 1783205006297
  },
  {
    "data": {
      "model": "gemini-3-flash-preview",
      "costUsd": 0.0016178,
      "provider": "openai",
      "latencyMs": 4174,
      "promptTokens": 1,
      "completionTokens": 647
    },
    "event": "llm_result",
    "nodeId": "_context",
    "timestamp": 1783205010473
  },
  {
    "data": {
      "status": "ok",
      "nodeType": "llm"
    },
    "event": "node_end",
    "nodeId": "60b2ab16-dc7c-4cb8-a58f-696f721b8d6f",
    "timestamp": 1783205010473
  },
  {
    "data": {
      "nodeType": "passthrough"
    },
    "event": "node_start",
    "nodeId": "adf576c1-ddb0-4fef-980c-5b485a3204f2",
    "timestamp": 1783205010477
  },
  {
    "data": {},
    "event": "noOp",
    "nodeId": "passthrough",
    "timestamp": 1783205010477
  },
  {
    "data": {
      "status": "ok",
      "nodeType": "passthrough"
    },
    "event": "node_end",
    "nodeId": "adf576c1-ddb0-4fef-980c-5b485a3204f2",
    "timestamp": 1783205010477
  },
  {
    "data": {
      "nodeType": "passthrough"
    },
    "event": "node_start",
    "nodeId": "3db2116c-abde-4856-bd1e-a15e0275477f",
    "timestamp": 1783205010480
  },
  {
    "data": {},
    "event": "noOp",
    "nodeId": "passthrough",
    "timestamp": 1783205010480
  },
  {
    "data": {
      "status": "ok",
      "nodeType": "passthrough"
    },
    "event": "node_end",
    "nodeId": "3db2116c-abde-4856-bd1e-a15e0275477f",
    "timestamp": 1783205010480
  },
  {
    "data": {
      "nodeType": "llm"
    },
    "event": "node_start",
    "nodeId": "9bdc3fa9-d4a0-4040-bb32-6c76aaca3ad9",
    "timestamp": 1783205010483
  },
  {
    "data": {
      "messages": 2,
      "maxTokens": 1024
    },
    "event": "calling openai/gpt-4o-mini",
    "nodeId": "llm",
    "timestamp": 1783205010483
  },
  {
    "data": {
      "model": "gpt-4o-mini",
      "provider": "openai"
    },
    "event": "llm_call",
    "nodeId": "_context",
    "timestamp": 1783205010483
  },
  {
    "data": {
      "model": "gemini-3-flash-preview",
      "costUsd": 0.00040919999999999997,
      "provider": "openai",
      "latencyMs": 1949,
      "promptTokens": 64,
      "completionTokens": 156
    },
    "event": "llm_result",
    "nodeId": "_context",
    "timestamp": 1783205012434
  },
  {
    "data": {
      "status": "ok",
      "nodeType": "llm"
    },
    "event": "node_end",
    "nodeId": "9bdc3fa9-d4a0-4040-bb32-6c76aaca3ad9",
    "timestamp": 1783205012434
  },
  {
    "data": {
      "nodeType": "set"
    },
    "event": "node_start",
    "nodeId": "efa8f415-62f7-43b3-a76a-a2eabf779cb8",
    "timestamp": 1783205012439
  },
  {
    "data": {
      "inputKeys": [
        "id",
        "name",
        "nodes",
        "workflow_id",
        "workflow_name",
        "credentials"
      ],
      "mergeKeys": []
    },
    "event": "merged",
    "nodeId": "set",
    "timestamp": 1783205012439
  },
  {
    "data": {
      "status": "ok",
      "nodeType": "set"
    },
    "event": "node_end",
    "nodeId": "efa8f415-62f7-43b3-a76a-a2eabf779cb8",
    "timestamp": 1783205012439
  },
  {
    "data": {
      "nodeType": "code"
    },
    "event": "node_start",
    "nodeId": "cf04eff5-12b2-42fb-9089-2d0c992af1b8",
    "timestamp": 1783205012439
  },
  {
    "data": {
      "mode": "read",
      "status": "ok",
      "service": "code",
      "latencyMs": 0,
      "operation": "no-source",
      "simulated": true
    },
    "event": "integration_mocked",
    "nodeId": "integration",
    "timestamp": 1783205012439
  },
  {
    "data": {
      "status": "ok",
      "nodeType": "code"
    },
    "event": "node_end",
    "nodeId": "cf04eff5-12b2-42fb-9089-2d0c992af1b8",
    "timestamp": 1783205012439
  }
]