Add Source and Sync First Workflow
This example walks through adding a LangFlow source and syncing your first workflow.Step 1: Add LangFlow Source
Step 2: List Available Flows
Step 3: Sync a Specific Flow
Step 4: Verify Workflow
Troubleshooting
Problem:Source validation failed: Connection refused
Solution: Ensure LangFlow is running on the specified URL:
Failed to sync flow: API key invalid
Solution: Verify your API key in LangFlow settings and update:
Create Daily Schedule
This example creates a schedule that runs a workflow every day at 8 AM.Step 1: Start Interactive Schedule Creation
Step 2: Follow Interactive Prompts
Step 3: Verify Schedule
Step 4: Start Worker to Execute Schedule
Common Schedule Patterns
Every 5 minutes:Modify Schedule Later
Update the schedule time:Debug Failed Task
This example shows how to identify and fix a failed workflow execution.Step 1: List Failed Tasks
Step 2: View Task Details
Step 3: Identify the Problem
The error shows that the workflow is missing the ‘FileReader’ component. This could mean:- The workflow was modified in LangFlow after syncing
- The component was removed or renamed
Step 4: Fix the Workflow
Option A: Re-sync the workflow from LangFlow If you fixed the workflow in LangFlow:Step 5: Retry the Failed Task
Step 6: Verify Success
Common Failure Patterns
Connection Errors:- Check if the source (LangFlow/Hive) is running
- Verify the source URL is correct
- Check network/firewall settings
- Verify the API key is correct
- Update the source API key:
- Workflow is taking too long to execute
- Check the workflow for infinite loops or long operations
- Increase timeout in worker configuration
- Check the input data format expected by the workflow
- View workflow definition to understand required input structure
Debugging Tips
Check worker logs:Scale Workers
This example shows how to scale worker capacity for high-throughput workloads.Check Current Worker Status
Understanding Worker Concurrency
Spark uses Celery workers with configurable concurrency:- Default: 2 worker threads
- Recommendation: Number of CPU cores for CPU-bound tasks
- Recommendation: 2-4x CPU cores for I/O-bound tasks (API calls, database queries)
Stop Current Worker
Start Worker with More Threads
For 4 concurrent tasks:Monitor Worker Performance
Check active tasks:Horizontal Scaling with Multiple Workers
For even higher throughput, run multiple worker processes: Terminal 1 - Primary worker:Production Scaling Recommendations
Small workload (< 100 tasks/day):- Use multiple worker processes (horizontal scaling)
- Monitor Redis memory usage
- Consider Redis cluster for high availability
- Use PostgreSQL connection pooling
Docker Compose Scaling
For production deployments with Docker Compose:Monitoring Metrics
Task completion rate:Performance Tuning
Redis Configuration:Troubleshooting Scaling Issues
Workers not picking up tasks:- Check Redis connection:
redis-cli ping - Verify all workers connect to same Redis instance
- Check worker logs:
automagik-spark worker logs --follow
- Reduce worker threads
- Check for memory leaks in workflows
- Monitor with:
docker statsorhtop
- Increase Celery task timeout
- Optimize workflow execution time
- Check network latency to LangFlow/Hive

