{
  "author": {
    "address": "0xc820da3Ce55C600A6282D2B21083Fe5Aa7E51F3D",
    "signature": "79900b8da92143ca1dbbb2658fc128ed1a3525637820390d6fda5ce06e9826b66d696a0e80028078de08630eaea596b2ab0f46bb9622176ac0c677e3c3c1c5231c"
  },
  "available_to_orchestrator": true,
  "changelog": "Built a receipt-to-tax-summary PDF workflow with real PDF ingestion, cautious extraction, and two passing fictional demo cases.",
  "content_hash": "sha256:00a7fd36567b009e1a9ce9790ee44019f6946f2c0ba857c5cb1f7dfc068865f4",
  "created_at": "2026-10-19T16:51:48Z",
  "format": "osaurus.template",
  "format_version": 1,
  "id": "CCF1AE0A-9ADE-4DA1-8C85-FF5EECE19299",
  "kind": "workflow",
  "name": "Receipt Tax Summary PDF",
  "requirements": {
    "knowledge": [],
    "mcp_servers": [],
    "models": [
      {
        "locality": "cloud_allowed",
        "needs_tool_use": false,
        "slot": "main",
        "strictness": "preferred"
      }
    ],
    "network": [],
    "notes": {},
    "permissions": [],
    "plugins": [],
    "secrets": [],
    "tools": [
      "file_read",
      "file_write"
    ]
  },
  "summary": "Extracts key tax details from a receipt PDF and creates a simple PDF summary.",
  "version": 1,
  "workflow": {
    "edges": [
      {
        "from": "extract_details",
        "to": "make_pdf"
      },
      {
        "from": "choose_source",
        "to": "read_receipt",
        "when": {
          "op": "equals",
          "path": "mode",
          "value": "file"
        }
      },
      {
        "from": "choose_source",
        "to": "demo_receipt",
        "when": {
          "op": "equals",
          "path": "mode",
          "value": "demo"
        }
      },
      {
        "from": "read_receipt",
        "to": "extract_details"
      },
      {
        "from": "demo_receipt",
        "to": "extract_details"
      }
    ],
    "examples": [
      {
        "input": {
          "demo_case": "Complete receipt",
          "use_demo": true
        },
        "name": "Complete fictional receipt"
      },
      {
        "input": {
          "demo_case": "Incomplete receipt",
          "use_demo": true
        },
        "name": "Incomplete fictional receipt"
      }
    ],
    "input_schema": {
      "additionalProperties": false,
      "properties": {
        "demo_case": {
          "default": "Complete receipt",
          "description": "Choose a clean or incomplete fictional receipt for testing.",
          "enum": [
            "Complete receipt",
            "Incomplete receipt"
          ],
          "title": "Demo case",
          "type": "string"
        },
        "receipt_pdf": {
          "description": "Choose one receipt PDF, unless you are using a demo receipt.",
          "format": "file",
          "title": "Receipt PDF",
          "type": "string"
        },
        "use_demo": {
          "default": false,
          "description": "Turn this on to test with fictional receipt data.",
          "title": "Use demo receipt",
          "type": "boolean"
        }
      },
      "required": [
        "use_demo",
        "demo_case"
      ],
      "type": "object",
      "x-order": [
        "receipt_pdf",
        "use_demo",
        "demo_case"
      ]
    },
    "model_slots": [],
    "nodes": [
      {
        "id": "read_receipt",
        "input": {
          "max_chars": 30000,
          "path": "{{input.receipt_pdf}}"
        },
        "intent": "Read receipt PDF",
        "kind": "tool",
        "name": "Read receipt PDF",
        "output_schema": {},
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 60,
        "tool": {
          "name": "file_read"
        }
      },
      {
        "id": "extract_details",
        "inference": {
          "instructions": "Extract tax-record details from whichever receipt text input is present. Never invent missing values. Use \"Unknown\" for missing text fields. Preserve the displayed currency and amounts. Pick the most plausible broad category from the allowed list; use Other if uncertain. Set needs_review true if the receipt is unreadable, any key field is missing, arithmetic appears inconsistent, or the category is uncertain. Keep notes brief and explicitly mention uncertainty. This organizes records and is not tax advice.",
          "mode": "generate",
          "model_slot": "main",
          "temperature": 0.1
        },
        "input": {
          "demo_receipt_text": "{{nodes.demo_receipt.output.text}}",
          "uploaded_receipt_text": "{{nodes.read_receipt.output.text}}"
        },
        "intent": "Extract tax details",
        "kind": "inference",
        "name": "Extract tax details",
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "category": {
              "enum": [
                "Advertising",
                "Meals",
                "Office supplies",
                "Professional services",
                "Software and subscriptions",
                "Travel",
                "Vehicle",
                "Utilities",
                "Other"
              ],
              "type": "string"
            },
            "currency": {
              "type": "string"
            },
            "date": {
              "type": "string"
            },
            "needs_review": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "payment_method": {
              "type": "string"
            },
            "subtotal": {
              "type": "string"
            },
            "tax": {
              "type": "string"
            },
            "total": {
              "type": "string"
            },
            "vendor": {
              "type": "string"
            }
          },
          "required": [
            "vendor",
            "date",
            "subtotal",
            "tax",
            "total",
            "currency",
            "category",
            "payment_method",
            "notes",
            "needs_review"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 120
      },
      {
        "id": "make_pdf",
        "input": {
          "content": "# Receipt Tax Summary\n\n> Record-organizing aid only; not tax advice.\n\n| Field | Extracted value |\n|---|---|\n| Vendor | {{nodes.extract_details.output.vendor}} |\n| Date | {{nodes.extract_details.output.date}} |\n| Subtotal | {{nodes.extract_details.output.subtotal}} |\n| Tax | {{nodes.extract_details.output.tax}} |\n| Total | {{nodes.extract_details.output.total}} |\n| Currency | {{nodes.extract_details.output.currency}} |\n| Suggested category | {{nodes.extract_details.output.category}} |\n| Payment method | {{nodes.extract_details.output.payment_method}} |\n| Needs review | {{nodes.extract_details.output.needs_review}} |\n\n## Notes\n\n{{nodes.extract_details.output.notes}}\n\n## Source\n\n{{input.receipt_pdf}}\n",
          "path": "receipt-tax-summary.pdf"
        },
        "intent": "Create summary PDF",
        "kind": "tool",
        "name": "Create summary PDF",
        "output_schema": {},
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 60,
        "tool": {
          "name": "file_write"
        }
      },
      {
        "code": {
          "network": [],
          "secrets": [],
          "source": "async function run(input, ctx) {\n  if (input.use_demo) return { mode: \"demo\" };\n  if (!input.receipt_pdf) throw new Error(\"Choose a receipt PDF or turn on Use demo receipt.\");\n  return { mode: \"file\" };\n}",
          "timeout": 30
        },
        "id": "choose_source",
        "input": {
          "receipt_pdf": "{{input.receipt_pdf}}",
          "use_demo": "{{input.use_demo}}"
        },
        "intent": "Choose receipt source",
        "kind": "code",
        "name": "Choose receipt source",
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "mode": {
              "enum": [
                "file",
                "demo"
              ],
              "type": "string"
            }
          },
          "required": [
            "mode"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 120
      },
      {
        "code": {
          "network": [],
          "secrets": [],
          "source": "async function run(input, ctx) {\n  if (input.demo_case === \"Incomplete receipt\") {\n    return { text: `FICTIONAL FADED TEST RECEIPT — NOT A REAL PURCHASE\\nVendor unreadable\\nDate unreadable\\nItem: business supplies\\nTotal $19.??\\nCurrency and payment method not visible` };\n  }\n  return { text: `FICTIONAL TEST RECEIPT — NOT A REAL PURCHASE\\nNorthstar Office Supply\\nOctober 15, 2026\\nPrinter paper  $18.00\\nPens          $10.00\\nSubtotal      $28.00\\nSales tax      $2.80\\nTotal         $30.80 USD\\nPaid: Visa ending 4242` };\n}",
          "timeout": 30
        },
        "id": "demo_receipt",
        "input": {
          "demo_case": "{{input.demo_case}}"
        },
        "intent": "Load fictional demo receipt",
        "kind": "code",
        "name": "Load fictional demo receipt",
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "text": {
              "type": "string"
            }
          },
          "required": [
            "text"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 120
      }
    ],
    "output": {
      "category": "{{nodes.extract_details.output.category}}",
      "date": "{{nodes.extract_details.output.date}}",
      "needs_review": "{{nodes.extract_details.output.needs_review}}",
      "summary_pdf": "{{nodes.make_pdf.output.path}}",
      "total": "{{nodes.extract_details.output.total}}",
      "vendor": "{{nodes.extract_details.output.vendor}}"
    },
    "output_schema": {
      "additionalProperties": false,
      "properties": {
        "category": {
          "title": "Tax category",
          "type": "string"
        },
        "date": {
          "title": "Receipt date",
          "type": "string"
        },
        "needs_review": {
          "title": "Needs review",
          "type": "boolean"
        },
        "summary_pdf": {
          "format": "file",
          "title": "Tax summary PDF",
          "type": "string"
        },
        "total": {
          "title": "Total",
          "type": "string"
        },
        "vendor": {
          "title": "Vendor",
          "type": "string"
        }
      },
      "required": [
        "summary_pdf",
        "vendor",
        "date",
        "total",
        "category",
        "needs_review"
      ],
      "type": "object"
    },
    "requirement_notes": {},
    "secrets": []
  }
}