Overview
While Serverless Workflow provides standard protocols for most use cases, you can define custom call functions to integrate with proprietary systems, legacy protocols, or emerging standards.Creating Custom Functions
Custom protocols are implemented as reusable functions in the workflow’suse.functions section.
Basic Pattern
Common Custom Protocol Patterns
SOAP Protocol
Wrap SOAP calls using HTTP:GraphQL Protocol
Implement GraphQL queries:Custom Binary Protocol
Use containers to implement custom protocols:Wrapper for Third-Party SDK
Run scripts that use third-party SDKs:Protocol Extension with MCP
For AI-driven integrations, use the Model Context Protocol (MCP):Advanced Patterns
Protocol with Retry Logic
Protocol with Custom Authentication
Multi-Step Protocol Workflow
Best Practices
Documentation
- Document custom protocols clearly in the workflow metadata
- Provide examples of input/output schemas
- Include error handling documentation
Reusability
- Define custom protocols as reusable functions in
use.functions - Use catalogs to share custom protocols across workflows
- Version custom protocol implementations
Error Handling
- Always wrap custom protocol calls in try/catch blocks
- Define appropriate retry policies
- Provide meaningful error messages
Security
- Never hardcode credentials in custom protocol definitions
- Use the secrets mechanism for sensitive data
- Apply appropriate authentication policies
Performance
- Consider using containers for heavy protocol implementations
- Cache protocol initialization where possible
- Set appropriate timeouts
Testing Custom Protocols
Runtime Support
Custom protocols are ultimately executed by the workflow runtime. Ensure your runtime supports:- The base protocol you’re building on (HTTP, gRPC, container, script)
- Any required libraries or dependencies
- The computational resources needed
Related
- HTTP Protocol - Base HTTP protocol
- gRPC Protocol - Base gRPC protocol
- Run Task - Execute containers and scripts
- Functions - Define reusable functions
- Catalogs - Share functions across workflows