Skip to main content

What are Actions?

Actions are the fundamental building blocks of Ziet. They’re Python functions decorated with @Action that become serverless, scalable units of work with automatic:
  • Retries with exponential backoff
  • Timeout protection
  • Error handling
  • Observability and logging
  • Serverless scaling

Basic Action

Action Parameters

Configure action behavior with decorator parameters:

Parameter Details

string
Unique identifier for the action. Defaults to module.function_name.
string
required
Human-readable description of what the action does. Used in logs and dashboard.
int
default:"300"
Maximum execution time in seconds. Action is terminated if exceeded.
int
default:"0"
Number of retry attempts on failure. Uses exponential backoff.

Retry Behavior

Actions automatically retry on exceptions using exponential backoff:
Retry schedule:
  • Attempt 1: Immediate execution
  • Attempt 2: Wait 2 seconds
  • Attempt 3: Wait 4 seconds
  • Attempt 4: Wait 8 seconds
  • Max backoff: 30 seconds
What triggers a retry:
  • Any unhandled exception
  • Timeout errors
  • Network errors
What doesn’t trigger a retry:
  • Successful execution (no exception)
  • Explicit return statement

Timeout Protection

Prevent actions from running indefinitely:
Important: Set appropriate timeouts based on your action’s expected duration.
  • Too short: Premature termination
  • Too long: Wasted resources on hung operations

Error Handling

Automatic Error Handling

Actions automatically log errors and provide stack traces:
If this fails:
  1. Error is logged with full stack trace
  2. Action retries (if retries > 0)
  3. Memory stores error details
  4. Dashboard shows failure reason

Manual Error Handling

Add custom error handling:

Using Integrations

Actions can use built-in integrations:
View all integrations →

Using Memory

Share data between actions using memory:
Learn more about Memory →

Testing Actions

Test your actions locally before deploying:
This runs your action in local mode with test data. You’ll see:
  • Action execution
  • Memory operations
  • Integration calls (mocked locally)
  • Execution time and logs
Expected output:

Best Practices

Each action should do one thing well.Good
Bad
Use clear, action-oriented names.Good
  • fetch_user_profile
  • calculate_shipping_cost
  • send_confirmation_email
Bad
  • get_data
  • do_thing
  • process
Add docstrings explaining what the action does.
Match timeout to expected duration.
Add retries for operations that might fail transiently.

Limitations

Current limitations (subject to change):
  • Max execution time: 15 minutes (900 seconds)
  • Max memory: 10GB per action
  • Max payload size: 6MB input/output
  • No persistent file system: Use memory or external storage
  • No background threads: All work must complete before return

Next Steps

Agents

Learn how to orchestrate actions with agents

Memory

Master memory operations

Integrations

Explore built-in integrations

Strategies

Add manual approval and wait conditions