Версия: 2.0.0
Дата: 2025-11-10
workflows:
deal_pipeline:
trigger: entity.Deal.stage_changed
steps:
- name: Send notification
when: stage == 'won'
action: send_notification
params:
template: deal_won
- name: Create invoice
when: stage == 'won'
action: create_entity
params:
entity: Invoice
processes:
order_fulfillment:
start: order_created
tasks:
- id: validate_payment
type: service
- id: reserve_inventory
type: service
- id: ship_order
type: service
end: order_shipped
from cifra.tasks import task
@task
async def send_email(to: str, subject: str, body: str):
await email_service.send(to, subject, body)
# Enqueue
await send_email.delay(
to='user@example.com',
subject='Welcome',
body='Hello!'
)
from cifra.tasks import scheduled_task
@scheduled_task(cron='0 2 * * *') # 2 AM daily
async def daily_backup():
await backup_service.backup_database()
@task(retry=3, retry_delay=60)
async def api_call_with_retry(url: str):
try:
response = await http_client.get(url)
return response.json()
except HTTPError:
raise TaskRetry()
Следующий документ: DATA_MANAGEMENT.md →