Skip to main content
Glama
schemas.py1.77 kB
""" Data Contracts - Pydantic Models Defines the structure of data exchanged with n8n API. """ from typing import List, Dict, Any, Optional from pydantic import BaseModel, Field class WorkflowNode(BaseModel): """Represents a single node in an n8n workflow.""" id: str name: str type: str position: List[int] = Field(default_factory=lambda: [0, 0]) parameters: Dict[str, Any] = Field(default_factory=dict) typeVersion: float = 1.0 class WorkflowConnections(BaseModel): """Represents connections between nodes.""" # Key: Source node name, Value: Connection details connections: Dict[str, Any] = Field(default_factory=dict) class WorkflowSummary(BaseModel): """Lightweight workflow info for listing.""" id: str name: str active: bool tags: List[str] = Field(default_factory=list) class WorkflowSpec(BaseModel): """Full workflow specification.""" id: Optional[str] = None name: str nodes: List[Dict[str, Any]] connections: Dict[str, Any] active: bool = False settings: Dict[str, Any] = Field(default_factory=lambda: { "saveManualExecutions": True, "saveExecutionProgress": True }) class ExecutionError(BaseModel): """Details of a failed execution.""" execution_id: str workflow_id: str workflow_name: Optional[str] = None started_at: Optional[str] = None failed_node: str = "Unknown" error_message: str = "Unknown Error" class DeployResult(BaseModel): """Result of a workflow deployment.""" status: str action: str # "created" or "updated" id: str name: str class OperationResult(BaseModel): """Generic operation result.""" status: str message: str workflow_id: Optional[str] = None

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SrAndres629/n8n_dev_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server