Blocks
Build reusable components with system, user, and custom blocks
What is a Block?
A block is a reusable execution unit within a workflow. It binds a handler and a specific action with parameter and output schemas, plus runtime configuration. Blocks can be system-provided or user-created, and may be triggers or regular processing steps.
Block Aspects
Blocks have different aspects that define their characteristics. A single block can have multiple aspects - for example, a user-created trigger block that integrates with Gmail.
Ownership
Who created and owns the block
System Blocks
is_system: trueBuilt-in blocks provided by Blocktion platform
User Blocks
is_system: falseCustom blocks created by users
Purpose
What the block is designed to do
Trigger Blocks
is_trigger: trueBlocks that initiate workflow execution
Regular Blocks
is_trigger: falseStandard processing blocks in workflows
Integration
External service connectivity
Integration Blocks
is_integration: trueBlocks that connect to external services
Standalone Blocks
is_integration: falseSelf-contained blocks with no external dependencies
Reusability
How the block can be reused
Template Blocks
is_template: trueReusable templates for creating other blocks
Instance Blocks
is_template: falseConcrete block instances ready for execution
Block Tags
Blocks are categorized using tags for better organization and discoverability. Tags help filter and search for specific types of blocks.
HTTP & Networking
Web requests and network operations
Data & Storage
Database and data operations
Triggers
Workflow initiation methods
Integrations
External service connections
Code & AI
Programming and AI operations
Communication
Messaging and notifications
Overview
Blocks are reusable components that can be used in workflows. Each block has multiple aspects that define its characteristics and behavior.
Block Structure
- • Handler & Action - Defines execution logic
- • Parameters - Input schema and validation
- • Outputs - Output schema definition
- • Configuration - Runtime settings and options
- • Tags - Categorization and searchability
Key Features
- • Reusable across multiple workflows
- • Parameter validation and type checking
- • Fallback behavior configuration
- • Marketplace publishing support
- • Template-based creation
Example Block Combinations
• User + Trigger + Integration - Custom Gmail webhook trigger
• System + Regular + Standalone - Built-in data transform block
• User + Template + Integration - Reusable email template for Slack
Endpoints
/api/blocksList Blocks
List blocks with pagination and filters
Query Parameters
tag(string)Filter by tagis_system(boolean)System or user blockssearch(string)Search by name or descriptionpage(number)Page number (starts at 1)limit(number)Items per page (default 10)Response
{
"data": [
{
"id": "block_123456",
"name": "Send Email Block",
"description": "A powerful block for sending emails via SMTP",
"is_system": false,
"is_template": false,
"parameters": {},
"outputs": {},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:22:00Z",
"user_id": "user_123",
"icon": null,
"category_icon": null,
"ui_schema": null,
"is_trigger": false,
"trigger_config": null,
"is_integration": false,
"provider_id": null,
"provider_name": null,
"handler": "email_handler",
"action": "send_email",
"tags": [
"communication"
]
}
],
"total": 1,
"page": 1,
"limit": 10
}cURL Example
curl -X GET "https://api.blocktion.io/api/blocks" \ -H "Authorization: Bearer <your_access_token>"
/api/blocks/systemList System Blocks
List system blocks with pagination and filters
Query Parameters
tag(string)Filter by tagsearch(string)Search by name or descriptionpage(number)Page number (starts at 1)limit(number)Items per page (default 10)Response
{
"data": [],
"total": 0,
"page": 1,
"limit": 10
}cURL Example
curl -X GET "https://api.blocktion.io/api/blocks/system"
/api/blocks/{block_id}Get Block
Get block by ID
Response
{
"data": {
"id": "block_123456",
"name": "Send Email Block",
"description": "A powerful block for sending emails via SMTP",
"is_system": false,
"is_template": false,
"parameters": {},
"outputs": {},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:22:00Z",
"user_id": "user_123",
"handler": "email_handler",
"action": "send_email",
"tags": [
"communication"
],
"icon": null,
"category_icon": null,
"ui_schema": null,
"is_trigger": false,
"trigger_config": null,
"is_integration": false,
"provider_id": null,
"provider_name": null
}
}cURL Example
curl -X GET "https://api.blocktion.io/api/blocks/{block_id}" \
-H "Authorization: Bearer <your_access_token>"/api/blocksCreate Block
Create a new block
Request Body
{
"name": "string (required)",
"description": "string (optional)",
"is_system": "boolean (optional, default: false)",
"is_template": "boolean (optional, default: false)",
"handler": "string (required)",
"action": "string (optional)",
"parameters": "Record<string, Parameter> (optional)",
"outputs": "Record<string, Output> (optional)",
"ui_schema": "object (optional)",
"icon": "string (optional)",
"color": "string (optional)",
"tags": "string[] (optional)",
"is_integration": "boolean (optional)",
"provider_id": "string (optional)",
"provider_name": "string (optional)"
}Response
{
"data": {
"id": "block_123456",
"name": "Send Email Block",
"description": "A powerful block for sending emails via SMTP",
"is_system": false,
"is_template": false,
"parameters": {},
"outputs": {},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"user_id": "user_123",
"handler": "email_handler",
"action": "send_email",
"tags": [
"communication"
]
}
}cURL Example
curl -X POST "https://api.blocktion.io/api/blocks" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_access_token>" \
-d '{
"name": "string (required)",
"description": "string (optional)",
"is_system": "boolean (optional, default: false)",
"is_template": "boolean (optional, default: false)",
"handler": "string (required)",
"action": "string (optional)",
"parameters": "Record<string, Parameter> (optional)",
"outputs": "Record<string, Output> (optional)",
"ui_schema": "object (optional)",
"icon": "string (optional)",
"color": "string (optional)",
"tags": "string[] (optional)",
"is_integration": "boolean (optional)",
"provider_id": "string (optional)",
"provider_name": "string (optional)"
}'/api/blocks/clone/{system_block_id}Clone System Block
Clone a system block to a user block
Response
{
"data": {
"id": "block_789",
"name": "Cloned System Block"
}
}cURL Example
curl -X POST "https://api.blocktion.io/api/blocks/clone/{system_block_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_access_token>"/api/blocks/{block_id}Update Block
Update an existing block
Request Body
{
"name": "string (optional)",
"description": "string (optional)",
"parameters": "Record<string, Parameter> (optional)",
"outputs": "Record<string, Output> (optional)",
"handler": "string (optional)",
"action": "string (optional)",
"tags": "string[] (optional)",
"is_integration": "boolean (optional)",
"provider_id": "string (optional)",
"provider_name": "string (optional)"
}Response
{
"data": {
"id": "block_123456",
"name": "Send Email Block"
}
}cURL Example
curl -X PUT "https://api.blocktion.io/api/blocks/{block_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_access_token>" \
-d '{
"name": "string (optional)",
"description": "string (optional)",
"parameters": "Record<string, Parameter> (optional)",
"outputs": "Record<string, Output> (optional)",
"handler": "string (optional)",
"action": "string (optional)",
"tags": "string[] (optional)",
"is_integration": "boolean (optional)",
"provider_id": "string (optional)",
"provider_name": "string (optional)"
}'/api/blocks/{block_id}Delete Block
Delete a block
Response
{
"data": {
"success": true,
"id": "block_123456"
}
}cURL Example
curl -X DELETE "https://api.blocktion.io/api/blocks/{block_id}" \
-H "Authorization: Bearer <your_access_token>"/api/blocks/{block_id}/executeExecute Block
Execute a block with inputs
Request Body
{
"inputs": "object (required)"
}Response
{
"data": {
"success": true,
"output": {}
}
}cURL Example
curl -X POST "https://api.blocktion.io/api/blocks/{block_id}/execute" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_access_token>" \
-d '{
"inputs": "object (required)"
}'/api/blocks/{block_id}/publishPublish Block
Publish a block to the marketplace
Response
{
"data": {
"block_id": "block_123456",
"status": "published"
},
"message": "Block published successfully"
}cURL Example
curl -X POST "https://api.blocktion.io/api/blocks/{block_id}/publish" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_access_token>"Best Practices
Guidelines for creating and using blocks effectively
Block Design
- • Keep blocks focused on a single responsibility
- • Use descriptive names and clear documentation
- • Validate input parameters thoroughly
- • Handle errors gracefully with meaningful messages
Performance
- • Optimize for execution speed and memory usage
- • Use caching for expensive operations
- • Implement proper timeout handling
- • Monitor block execution metrics