Overview
The Anyway SDK provides two decorators to structure your traces:@workflow- High-level operations that orchestrate multiple tasks@task- Individual units of work (like LLM calls)
Basic Setup
The @workflow Decorator
Use@workflow for top-level operations that coordinate multiple steps:
The @task Decorator
Use@task for individual operations, especially LLM calls:
Complete Example
- OpenAI
- Anthropic
Streaming
- OpenAI
- Anthropic
Tool Use / Function Calling
- OpenAI
- Anthropic
Async Support
Both decorators work seamlessly with async functions:- OpenAI
- Anthropic
View in Dashboard
After running your code, view traces in the Anyway Dashboard:- Navigate to Traces
- Find your workflow trace
- Expand to see nested task spans
- View timing, inputs, and outputs for each operation
Next Steps
Configuration
Configure endpoints and authentication
Customer & Order Attribution
Link traces to customers and orders
Cost Tracking
Monitor your AI spend