← Back to list

workato-sdk-advanced
by grailautomation
⭐ 0🍴 0📅 Jan 19, 2026
SKILL.md
name: Workato SDK Advanced description: This skill should be used when the user asks about "connector planning", "code patterns", "defining schema", "best practices workato", "error handling workato", "connector architecture", "object_definitions patterns", "reusable methods", or needs advanced guidance for building production-quality Workato connectors. version: 0.1.0
Workato SDK Advanced Patterns
Guide for advanced connector development patterns, architecture planning, and best practices.
Overview
Building production-quality connectors requires:
- Thoughtful planning and API analysis
- Reusable code patterns
- Proper schema design
- Robust error handling
- Performance optimization
Connector Planning
API Analysis Checklist
Before building a connector, analyze:
-
Authentication
- What auth method does the API use?
- Are there multiple auth options?
- How are tokens refreshed?
-
Data Model
- What are the primary objects/resources?
- How do objects relate to each other?
- What fields are required vs optional?
-
Operations
- What CRUD operations are available?
- Are there batch operations?
- What search/filter capabilities exist?
-
Webhooks/Events
- Does the API support webhooks?
- What events are available?
- How is webhook security handled?
-
Rate Limits
- What are the rate limits?
- How should the connector handle throttling?
Connector Structure
Organize connector code logically:
{
title: 'My Connector',
# 1. Connection & Auth
connection: { ... },
# 2. Reusable Methods
methods: { ... },
# 3. Object Definitions (Schemas)
object_definitions: { ... },
# 4. Pick Lists
pick_lists: { ... },
# 5. Actions
actions: { ... },
# 6. Triggers
triggers: { ... },
# 7. Streams (if needed)
streams: { ... }
}
Code Patterns
Reusable Methods
Extract common logic into methods:
methods: {
# Pagination helper
paginate: lambda do |endpoint, params = {}|
results = []
page = 1
loop do
response = get(endpoint).params(params.merge(page: page, per_page: 100))
results.concat(response['items'])
break unless response['has_more']
page += 1
end
results
end,
# Error handling wrapper
safe_request: lambda do |&block|
block.call
.after_error_response(/4\d{2}/) do |code, body, headers, message|
error("API Error (#{code}): #{body['error'] || message}")
end
.after_error_response(/5\d{2}/) do |code, body, headers, message|
error("Server Error (#{code}): Please try again later")
end
end,
# Field mapping
map_fields: lambda do |record, field_map|
field_map.each_with_object({}) do |(api_field, workato_field), result|
result[workato_field] = record[api_field] if record[api_field]
end
end
}
Using Methods
execute: lambda do |connection, input|
records = call('paginate', '/api/records', { status: 'active' })
records.map { |r| call('map_fields', r, { 'id' => 'record_id', 'name' => 'title' }) }
end
Schema Design
Object Definitions
Define reusable schemas:
object_definitions: {
# Base record schema
record: {
fields: lambda do |connection, config_fields|
[
{ name: 'id', label: 'Record ID' },
{ name: 'name', label: 'Name' },
{ name: 'created_at', label: 'Created At', type: 'date_time' },
{ name: 'updated_at', label: 'Updated At', type: 'date_time' }
]
end
},
# Input-specific schema (writable fields only)
record_input: {
fields: lambda do |connection, config_fields|
[
{ name: 'name', label: 'Name', optional: false },
{ name: 'email', label: 'Email', control_type: 'email' },
{ name: 'status', control_type: 'select', pick_list: 'statuses' }
]
end
},
# Dynamic schema based on config
dynamic_record: {
fields: lambda do |connection, config_fields|
object_type = config_fields['object_type']
get("/api/schemas/#{object_type}")['fields'].map do |field|
{
name: field['name'],
label: field['label'],
type: field['type'],
optional: !field['required']
}
end
end
}
}
Schema Composition
Combine schemas:
input_fields: lambda do |object_definitions|
[
{ name: 'id', optional: false }
].concat(object_definitions['record_input'])
end
Error Handling
Comprehensive Error Handling
execute: lambda do |connection, input|
post('/api/records')
.payload(input)
.after_error_response(400) do |code, body, headers, message|
# Validation errors
errors = body['errors']&.map { |e| e['message'] }&.join(', ')
error("Validation failed: #{errors || body['message']}")
end
.after_error_response(401) do |code, body, headers, message|
error("Authentication failed. Please reconnect.")
end
.after_error_response(403) do |code, body, headers, message|
error("Permission denied: #{body['message']}")
end
.after_error_response(404) do |code, body, headers, message|
error("Resource not found")
end
.after_error_response(429) do |code, body, headers, message|
retry_after = headers['Retry-After']
error("Rate limited. Retry after #{retry_after} seconds")
end
.after_error_response(/5\d{2}/) do |code, body, headers, message|
error("Server error (#{code}). Please try again later.")
end
end
Retry Logic
actions: {
create_with_retry: {
execute: lambda do |connection, input|
post('/api/records').payload(input)
end,
retry_on_response: [429, 503],
max_retries: 3
}
}
Best Practices
Naming Conventions
- Actions: Verb + noun (
create_record,search_contacts) - Triggers:
new_prefix (new_record,new_event) - Fields: snake_case matching API where possible
Performance
- Minimize API calls - Batch requests when possible
- Use pagination - Don't fetch all records at once
- Cache static data - Store picklist values
- Optimize webhooks - Use webhooks over polling when available
Security
- Never log credentials - Use
control_type: 'password' - Validate webhooks - Always verify signatures
- Sanitize inputs - Escape user data in URLs
- Use HTTPS - Never allow HTTP connections
User Experience
- Clear labels - Use descriptive field names
- Helpful hints - Explain what fields do
- Smart defaults - Pre-populate common values
- Validation - Catch errors before API calls
Debugging
Local Testing
# Add debug output
execute: lambda do |connection, input|
workato.log("Input: #{input.inspect}")
response = get('/api/records')
workato.log("Response: #{response.inspect}")
response
end
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| "undefined method" | Method not defined | Check method name spelling |
| Empty response | Wrong endpoint/params | Log request, check API docs |
| Auth fails | Token expired | Implement token refresh |
| Missing fields | Schema mismatch | Update object_definitions |
Reference Files
For detailed documentation:
Connector Guide
references/guides__advanced-connector-guide__introduction.md- Guide overviewreferences/guides__advanced-connector-guide__connector-planning.md- Planning checklistreferences/guides__advanced-connector-guide__connector-building-defining-schema.md- Schema designreferences/guides__advanced-connector-guide__connector-building-building-actions.md- Action patternsreferences/guides__advanced-connector-guide__connector-building-building-triggers.md- Trigger patternsreferences/guides__advanced-connector-guide__connector-building-code-patterns.md- Code patterns
Best Practices
references/guides__best-practices.md- General best practicesreferences/guides__error-handling.md- Error handling patternsreferences/guides__debugging.md- Debugging techniques
Score
Total Score
40/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon