core-sdk
Skill0 starsChanged 7 months agoApache-2.0View on GitHub
Kailash Core SDK fundamentals including workflow creation, node patterns, connections, runtime execution, parameter passing, error handling, cyclic workflows, async patterns, MCP integration, and installation. Use when asking about 'workflow basics', 'core sdk', 'create workflow', 'workflow builder', 'node patterns', 'connections', 'runtime', 'parameters', 'imports', 'installation', 'getting started', 'workflow execution', 'async workflows', 'error handling', 'cyclic workflows', 'PythonCode node', 'SwitchNode', or 'MCP integration'. Also covers observability: 'OpenTelemetry', 'OTel', 'tracing', 'TracingLevel', 'WorkflowTracer', 'node instrumentation', 'NodeInstrumentor', 'database instrumentation', 'Prometheus metrics', 'MetricsBridge', 'KAILASH_TRACING_LEVEL', or 'span attributes'.
In this repository37 other files it gives its agents.
- .claude/rules/agents.mdAGENTS.md
- .claude/guides/claude-code/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- dataflowSkill
- nexusSkill
- kaizenSkill
- kailash-mcpSkill
- cheatsheetsSkill
- development-guidesSkill
- nodes-referenceSkill
- workflow-patternsSkill
- deployment-gitSkill
- frontend-integrationSkill
- testing-strategiesSkill
- architecture-decisionsSkill
- code-templatesSkill
- enterprise-infrastructureSkill
- validation-patternsSkill
- gold-standardsSkill
- security-patternsSkill
- flutter-patternsSkill
- interactive-widgetsSkill
- enterprise-ai-uxSkill
- conversation-uxSkill
- uiux-design-principlesSkill
- value-auditSkill
- ai-interaction-patternsSkill
- eatp-referenceSkill
- coc-referenceSkill
- 29-pactSkill
- claude-code-patternsSkill
- error-troubleshootingSkill
- kailash-mlSkill
- kailash-alignSkill
- co-referenceSkill
- managementSkill
- projectSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
[workflow-quickstart](workflow-quickstart.md): - Create basic workflows with WorkflowBuilder
- Distinctive: line 43
[kailash-imports](kailash-imports.md): - Import patterns and module organization
- Distinctive: line 67
This is the single source of truth for node configuration: All other skills reference this section.
- Very specific: line 104
Always call .build() before execution
- Very specific: line 105
Never workflow.execute(runtime) - always runtime.execute(workflow.build())
- Distinctive: line 151
Use this skill when you need to:
- Distinctive: line 153
Create custom workflows from scratch
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Kailash Core SDK - Foundational Skills
Comprehensive guide to Kailash Core SDK fundamentals for workflow automation and integration.
Features
The Core SDK provides the foundational building blocks for creating custom workflows with fine-grained control:
- 110+ Workflow Nodes: Pre-built nodes for AI, API, database, file operations, logic, and more
- WorkflowBuilder API: String-based workflow construction with type safety
- Dual Runtime Support: AsyncLocalRuntime (Docker/async) and LocalRuntime (CLI/scripts)
- Advanced Patterns: Cyclic workflows, conditional execution, error handling
- MCP Integration: Built-in Model Context Protocol support
- Parameter Passing: Flexible data flow between nodes
- Zero Configuration: Auto-detection of runtime context
- Production Ready: Enterprise features including monitoring, validation, and debugging
Quick Start
from kailash.workflow.builder import WorkflowBuilder
from kailash.runtime.local import LocalRuntime
workflow = WorkflowBuilder()
workflow.add_node("NodeName", "id", {"param": "value"})
# Use context manager for proper resource cleanup (recommended)
with LocalRuntime() as runtime:
results, run_id = runtime.execute(workflow.build())Reference Documentation
Getting Started
- workflow-quickstart - Create basic workflows with WorkflowBuilder
- kailash-installation - Installation and setup guide
- kailash-imports - Import patterns and module organization
Core Patterns
- node-patterns-common - Common node usage patterns
- connection-patterns - Linking nodes and data flow
- param-passing-quick - Parameter passing strategies
- runtime-execution - Executing workflows (sync/async)
- runtime-lifecycle - Runtime lifecycle, ref counting, acquire/release, context managers
Advanced Topics
- async-workflow-patterns - Asynchronous workflow execution
- async-resource-safety -
__del__hardening, double-check locking, pool lifecycle, static analysis guardrails - cycle-workflows-basics - Cyclic workflow patterns
- error-handling-patterns - Error management strategies
- switchnode-patterns - Conditional routing with SwitchNode
- pythoncode-best-practices - PythonCode node best practices
- mcp-integration-guide - Model Context Protocol integration
Key Concepts
Canonical Node Pattern (4-Parameter)
This is the single source of truth for node configuration. All other skills reference this section.
workflow.add_node(
"NodeClassName", # 1. Node type (PascalCase, string)
"unique_node_id", # 2. Unique ID (snake_case, string)
{ # 3. Configuration dict
"param1": "value",
"param2": 123
},
connections=[] # 4. Optional: input connections
)| Parameter | Type | Description | Example |
| Node type | str | The node class name (PascalCase) | "LLMNode", "HTTPRequest" |
| Node ID | str | Unique identifier (snake_case) | "fetch_data", "process_1" |
| Config | dict | Node-specific configuration | {"url": "..."} |
| Connections | list | Optional input connections (4-tuple) | [("src", "out", "dst", "in")] |
Connection Methods:
# Method 1: add_connection (4-positional params - explicit)
workflow.add_connection("read_file", "content", "transform", "input")
# Method 2: connect (flexible API with keyword args)
workflow.connect("read_file", "transform", from_output="content", to_input="input")
# Method 3: connect with mapping (multiple outputs)
workflow.connect("node1", "node2", mapping={"content": "input", "meta": "metadata"})WorkflowBuilder Pattern
- String-based node API:
workflow.add_node("NodeName", "id", {}) - Always call
.build()before execution - Never
workflow.execute(runtime)- alwaysruntime.execute(workflow.build())
Runtime Selection
- AsyncLocalRuntime: For Docker/async (async contexts) - async-first, no threading, 10-100x faster
- LocalRuntime: For CLI/scripts (sync contexts) - synchronous execution with thread support
- get_runtime(): Auto-detection helper that selects appropriate runtime based on context
Both runtimes return identical structure: (results, run_id) tuple.
Runtime Architecture
Both LocalRuntime and AsyncLocalRuntime inherit from BaseRuntime with shared capabilities:
BaseRuntime Foundation:
- 29 configuration parameters (debug, enable_cycles, conditional_execution, connection_validation, etc.)
- Execution metadata management
- Common initialization and validation modes (strict, warn, off)
Shared Mixins:
- CycleExecutionMixin: Cyclic workflow execution with validation
- ValidationMixin: Workflow structure validation (5 methods)
- ConditionalExecutionMixin: Conditional execution and branching with SwitchNode support
AsyncLocalRuntime-Specific:
- WorkflowAnalyzer for optimal execution strategy
- Level-based parallelism for concurrent execution
- Thread pool for sync nodes without blocking
- Semaphore control to prevent resource exhaustion
Critical Rules
- ✅ ALWAYS:
runtime.execute(workflow.build()) - ✅ String-based nodes:
workflow.add_node("NodeName", "id", {}) - ✅ 4-parameter connections:
(source_id, source_param, target_id, target_param) - ✅ Docker/async: Use AsyncLocalRuntime (mandatory)
- ✅ CLI/Scripts: Use LocalRuntime
- ❌ NEVER:
workflow.execute(runtime) - ❌ NEVER: Instance-based nodes
- ❌ NEVER: Use LocalRuntime in Docker (causes hangs)
When to Use This Skill
Use this skill when you need to:
- Create custom workflows from scratch
- Understand workflow fundamentals
- Learn node patterns and connections
- Set up runtime execution
- Handle errors in workflows
- Implement cyclic or async patterns
- Integrate with MCP
- Get started with Kailash SDK
Related Skills
- 02-dataflow - Database operations framework built on Core SDK
- 03-nexus - Multi-channel platform framework built on Core SDK
- 04-kaizen - AI agent framework built on Core SDK
- 06-cheatsheets - Quick reference patterns
- 08-nodes-reference - Complete node reference
- 09-workflow-patterns - Industry workflow templates
- 17-gold-standards - Mandatory best practices
Support
For complex workflows or debugging, invoke:
pattern-expert- Workflow patterns and cyclic debuggingtesting-specialist- Test workflow implementations
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

