Documentation Index
Fetch the complete documentation index at: https://platform.docs.zenoo.com/llms.txt
Use this file to discover all available pages before exploring further.
Sharables
Sharables are a powerful feature that allows you to create secure, time-limited tokens for sharing executable workflows, functions, or data payloads. They enable asynchronous execution patterns, external integrations, and data polling mechanisms.Overview
There are two types of sharables:- Payload Sharables - Store data that can be accessed across different executions
- Execution Sharables - Create links that can be shared to start workflows or functions with specific data
sharable. Related events are stored in sharable-events Kafka topic.
Sharable events can be processed for real-time metrics and analytics purposes. There is also sharable-requests Kafka topic used
internally by hub to process sharable requests and commands.
Table of Contents
Getting Started
Execution Sharables
Payload Sharables
Lifecycle Management
Events and Monitoring
Integration Patterns
Operations
Token Management
Token Generation
- Default: 6 random alphanumeric characters (e.g.,
aB3xY9) - Custom: You can specify your own token
- Collision Handling: If a token already exists, the operation will fail
Security Considerations
- Tokens are bearer tokens - anyone with the token has full access
- Use appropriate expiration times to limit exposure
- Consider the security implications when sharing URLs containing tokens
- Store tokens securely and avoid logging them in plain text
Default Expiration
- Default expiration: 24 hours if not specified
- Custom expiration: Use
expireInwith ISO-8601 duration or simple format - Automatic cleanup: DynamoDB TTL automatically removes expired records
Execution Sharables
Execution sharables create links that can be shared to start workflows or functions with predefined or dynamic input data.DSL Syntax
Basic Function Execution
Workflow Execution
Advanced Options
DSL Options Reference
| Option | Description | Example |
|---|---|---|
function(name) | Execute a function | function 'my-function' |
workflow(name) | Execute a workflow | workflow 'my-workflow' |
input | Predefined input data | input userId: "123" |
context | Predefined context data | context region: "us-east" |
reusable() | Allow multiple executions | reusable() |
latest() | Resolve version at execution time | latest() |
namespace | Store result asynchronously | namespace result |
expireIn | Custom expiration time | expireIn "30m" |
url(template) | Custom URL template | url "https://example.com/${token}" |
Use Cases
1. Email Notifications with Actions
2. External System Integration
3. Multi-step Workflows
4. Reusable Service Endpoints
API Endpoints
Execute Sharable
201 Created- Execution started successfully400 Bad Request- Token doesn’t exist410 Gone- Token has expired504 Gateway Timeout- Operation timeout
Payload Sharables
Payload sharables store data that can be accessed across different executions, enabling polling and data sharing patterns.DSL Syntax
Use Cases
1. Polling Pattern
External systems can poll for data availability:2. Data Caching
Store computed results for reuse:API Endpoints
Retrieve Payload Data
200 OK- Payload data returned as JSON404 Not Found- Token doesn’t exist or has expired504 Gateway Timeout- Operation timeout
Expiration and Lifecycle
Expiration Behavior
- Payload Sharables: Expire based on
expireInsetting or default (24h) - Execution Sharables:
- Reusable: Only expire based on time settings
- Single-use: Expire after execution terminates OR time limit
Expiration Formats
Manual Expiration
Event System
Payload Sharable Events
CreatedPayloadSharable
Produced when payload sharable is created:token- identifier of created sharable
ExpiredSharable
Produced when payload sharable expires:token- identifier of expired sharableexecutable- associated function/workflow (if any)requestContext- execution context
Execution Sharable Events
CreatedExecuteSharable
Produced when execution sharable is created:token- identifier of created sharablereusable- whether sharable can be executed repeatedlyexecutable- function/workflow to executerequestContext- execution context
ExecutedSharable
Produced when execution sharable is invoked:token- identifier of executed sharableexecutable- function/workflow executedrequestContext- execution context
TerminatedSharable
Produced when workflow started by execution sharable terminates:token- identifier of terminated sharableexecutable- function/workflow terminatedrequestContext- execution context
Common Events
DeletedSharable
Produced when a sharable is deleted:token- identifier of deleted sharable
Error Events
All error events include:token- identifier of sharable that failedmessage- error message
CreatingPayloadSharableError
Produced when creating payload sharable failsCreatingExecuteSharableError
Produced when creating execute sharable failsDeletingSharableError
Produced when deleting sharable failsExecutingSharableError
Produced when executing sharable fails:errorType- GENERAL, SHARABLE_EXPIRED, SHARABLE_NOT_FOUND, COMPONENT_NOT_FOUND, NO_EXECUTE_REQUESTrequestContext- execution context
ExpiringSharableError
Produced when expiring sharable failsIntegration Patterns
1. Async Processing with Polling
2. External Callback Integration
3. User Action Workflows
4. Multi-tenant Service Access
5. Mobile Hand-off with Terminal Route Result
Pass execution control to a mobile device or external system, then receive the result back into the main execution flow:- Namespace Assignment: Use
namespacein the sharable to specify where the hand-off result will be stored - Terminal Route Result: The mobile workflow ends with
terminal(payload)to pass data back - Await Command:
await(namespace, timeout)pauses execution until the mobile workflow completes - Automatic Result Propagation: Terminal route result is automatically sent to the awaiting execution
- Timeout Handling: Use
onTimeoutblock to handle cases where the mobile workflow isn’t completed in time - Result Access: After await completes, access the result via the namespace variable (e.g.,
handoff)
- Mobile biometric verification during web onboarding
- Photo/document capture on mobile device
- Mobile signature collection
- Two-factor authentication via mobile app
- Mobile payment authorization
- Main execution creates sharable with namespace and starts await
- Mobile device receives sharable token and executes workflow independently
- Mobile workflow terminates with
terminal(result_data) - Result is automatically propagated to main execution’s namespace
- Main execution resumes and accesses result via namespace variable
Configuration and Operations
Timeout Configuration
Monitoring and Metrics
Monitor these Kafka topics for sharable activity:sharable-events- All sharable lifecycle eventssharable-requests- Internal processing requests
- Token creation rate
- Token execution rate
- Token expiration rate
- Error rates by type
- Average token lifetime
Storage Details
- DynamoDB Table:
sharable - Partition Key:
token(string) - TTL Attribute:
ttlEpochSecondsfor automatic cleanup - State Store: Kafka Streams state store for expiration tracking
Best Practices
-
Security
- Use appropriate expiration times
- Don’t log tokens in plain text
- Consider token rotation for long-lived services
-
Performance
- Use reusable tokens for high-frequency access
- Set reasonable expiration times to prevent storage bloat
- Monitor token usage patterns
-
Error Handling
- Always handle 410 Gone responses for expired tokens
- Implement retry logic for timeout errors
- Log sharable events for debugging
-
Integration
- Use polling patterns for async operations
- Implement proper webhook validation
- Consider rate limiting for reusable tokens
Troubleshooting
Common Issues
Token Not Found (400 Bad Request)
- Verify token exists and hasn’t been deleted
- Check for typos in token value
- Ensure proper URL encoding
Token Expired (410 Gone)
- Check
expireInsettings - Verify token hasn’t timed out
- For single-use tokens, ensure execution hasn’t already completed
Timeout Errors (504 Gateway Timeout)
- Check DynamoDB connectivity
- Verify operation timeout configuration
- Monitor Kafka topics for processing delays
Execution Errors
- Verify component availability
- Check function/workflow references
- Review execution permissions and context