{
        "priority": 10,
        "max_retries": 3,
        "steps": [
            {
                "step": 1,
                "action": "query",
                "description": "Get TaxCore configuration",
                "query": "SELECT config_id, api_base_url, org_tin, is_active FROM taxcore_configurations WHERE org_id = ${record.org_id} AND is_active = true LIMIT 1"
            },
            {
                "step": 2,
                "action": "query",
                "description": "Check if already submitted",
                "query": "SELECT submission_id FROM taxcore_submissions WHERE reference_table = 'sales_receipts' AND reference_id = ${record.receipt_id} LIMIT 1"
            },
            {
                "step": 3,
                "action": "conditional",
                "condition": "${step2.result.length} > 0",
                "then": "exit",
                "else": "continue"
            },
            {
                "step": 4,
                "action": "http_post",
                "description": "Submit to TaxCore service",
                "url": "http://taxcore-service:3001/sale",
                "payload": {
                    "receipt_id": "${record.receipt_id}",
                    "org_id": "${record.org_id}",
                    "receipt_number": "${record.receipt_number}",
                    "total_amount": "${record.total_amount}",
                    "tax_amount": "${record.tax_amount}"
                }
            },
            {
                "step": 5,
                "action": "trigger_event",
                "event": "${step4.success ? 'taxcore:submission:success' : 'taxcore:submission:failed'}",
                "data": "${step4.response}"
            }
        ]
    }