This directory contains various examples demonstrating how to use Taskinity in different scenarios. Each example is self-contained and includes all necessary files to run it, including Dockerfiles and docker-compose configurations where appropriate.
The Taskinity project has been reorganized into a more modular structure:
Core Module (taskinity/core/
): Contains essential functionality including task and flow decorators, DSL parser and executor, and flow management utilities.
Extensions Module (taskinity/extensions/
): Contains additional features like visualization tools, code converters, data processors, and API clients.
Utils Module (taskinity/utils/
): Provides supporting functionality like environment variable management, benchmarking tools, and logging utilities.
All examples in this directory have been updated to use the new module structure. The old flow_dsl
module references have been replaced with the new taskinity_core
module.
A complete example of using Taskinity to process emails. This example demonstrates how to:
Directory: email_processing
Examples of data processing pipelines using Taskinity. These examples show how to:
Directory: data_processing
Examples of integrating external APIs with Taskinity. These examples demonstrate:
Directory: api_integration
Examples of visualizing Taskinity flows. These examples show how to:
Directory: visualization
Examples of running tasks in parallel with Taskinity. These examples demonstrate:
Directory: parallel_tasks
This directory includes a centralized Makefile that allows you to run all examples and tests from one place. The Makefile is compatible with the new modular Taskinity structure (core, extensions, utils).
# Show all available commands
make help
# Run all examples
make run-all
# Run a specific example
make email-run # Run email processing example
make data-run # Run data processing example
make api-run # Run API integration example
make parallel-run # Run parallel tasks example
make viz-run # Run visualization example
make perf-run # Run performance benchmarks
# Run all tests
make test-all
# Run tests for a specific example
make email-test # Run email processing tests
make data-test # Run data processing tests
make api-test # Run API integration tests
make parallel-test # Run parallel tasks tests
make viz-test # Run visualization tests
make perf-test # Run performance benchmark tests
# Start Docker environments
make email-docker-basic # Start basic email Docker environment
make email-docker-mock # Start mock email Docker environment with MailHog
make email-docker-full # Start full email Docker environment
# Stop Docker environments
make email-docker-down # Stop all email Docker environments
# Start all Docker environments
make docker-up-all
# Stop all Docker environments
make docker-down-all
Each example directory also contains a README.md file with specific instructions for running that example manually. In general, you can follow these steps:
cd examples/[example_name]
cp .env.example .env
# Edit .env with your specific configuration
docker-compose up -d
Or use the provided shell scripts for Docker environments (in email_processing):
./docker-up.sh [basic|mock|full] # Start a specific Docker environment
./docker-down.sh [basic|mock|full] # Stop a specific Docker environment
python main.py
Where applicable, examples include performance comparisons with other solutions to demonstrate Taskinity’s efficiency. These comparisons typically measure:
Feel free to contribute your own examples by creating a pull request. Please follow these guidelines: