# preview_workflow

Dry-run a supported business workflow. For deal_to_estimate, previews the Sanka estimate draft and approval state. For deal_to_order, previews creating or reusing a Sanka Order from a HubSpot Deal or synced CRM revenue record. For deal_to_subscription, previews the Order-first subscription flow and supports HubSpot batch filters such as subscription_flag_property. For estimate_to_invoice, previews creating/reusing a Sanka Order from a Sanka Estimate before invoicing. For order_to_invoice, order_to_subscription, and order_to_purchase_order, previews billing, subscription, or shortage-driven procurement creation from Sanka Orders. For subscription_to_invoice, previews invoice generation from Sanka Subscriptions, including duplicate-period checks by start_date. For deal_to_order_handoff, previews a closed-won HubSpot Deal to Sanka order draft / fulfillment handoff with customer/contact resolution, line items, inventory availability, lead-time and delivery timing, duplicate warnings, and HubSpot writeback plan. For invoice_export, previews syncing explicitly scoped Sanka invoice drafts to freee or MoneyForward invoice drafts and returns needs_confirmation for ambiguous or broad sync requests without writing records. For freee, preview/start provider capabilities and next_actions are the source of truth: freee records are cancelled/restorable rather than physically deleted, allow_resync updates mapped draft/unregistered invoices, and allow_multiple_freee_drafts creates a separate draft only with explicit user intent. Use preview/start results, not list_integration_channels shadow/outbound flags, as the source of truth for accounting export blockers. For quote_readiness, checks whether a Salesforce Opportunity has enough clean data to quote and returns blockers, warnings, fixes, source links, and the generic Sanka platform-mapping reuse/create plan. For revenue_control_summary, summarizes read-only HubSpot closed-won revenue into won, quote_drafted, approval_pending, unbilled, invoiced, unpaid, and blocked buckets with totals and next actions. For sales_incentive_commission, calculates a draft/read-only commission report by rep and deal from HubSpot closed-won deals reconciled with Sanka invoices/orders, payment status, refunds/credits, margin, ownership splits, and Sanka incentive rules. Direct CRM deal_to_invoice is disabled; create an order first. Does not write records.

Agent View of the PolicyLayer registry record for `preview_workflow`. HTML page: https://policylayer.com/tools/sankahq-sanka-mcp/preview-workflow

## Facts

- Tool: `preview_workflow`
- Server: Sanka MCP Server (`sankahq/sanka-mcp`) — https://policylayer.com/tools/sankahq-sanka-mcp.md
- Homepage: https://github.com/sankaHQ/sanka-mcp
- Risk category: Execute (High risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Rate-limited

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "preview_workflow",
    "arguments": {}
  }
}
```

## Why preview_workflow is rated High

Although described as a 'preview' or 'dry-run', this tool executes complex business logic that interacts with multiple integrated systems (HubSpot CRM, Sanka Orders, Estimates, Invoices, Subscriptions). It triggers workflows whose effects depend on the workflow type and input arguments provided.

From the tool's own definition: "Tool performs 'dry-run' preview of business workflows including deal_to_estimate, deal_to_order, deal_to_subscription, estimate_to_invoice, and order_to_invoice."

## Use case

AI agents invoke preview_workflow to trigger actions in Sanka MCP Server. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Sanka MCP Server:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "preview_workflow": {
      "limits": [
        {
          "counter": "preview_workflow_rate",
          "window": "minute",
          "max": 10,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Sanka MCP Server (348)

- `cancel_buy_request` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/cancel-buy-request.md
- `cancel_export_job` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/cancel-export-job.md
- `cancel_import_job` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/cancel-import-job.md
- `cancel_workspace_invitation` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/cancel-workspace-invitation.md
- `delete_absence` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-absence.md
- `delete_approval_rule` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-approval-rule.md
- `delete_association` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-association.md
- `delete_attendance_record` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-attendance-record.md
- `delete_bill` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-bill.md
- `delete_company` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-company.md
- `delete_contact` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-contact.md
- `delete_deal` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-deal.md
- `delete_delivery_rule` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-delivery-rule.md
- `delete_disbursement` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-disbursement.md
- `delete_disbursement_allocation` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-disbursement-allocation.md
- `delete_estimate` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-estimate.md
- `delete_expense` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-expense.md
- `delete_ferry_diagram` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-ferry-diagram.md
- `delete_ferry_todo` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-ferry-todo.md
- `delete_inventory` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-inventory.md
- `delete_inventory_transaction` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-inventory-transaction.md
- `delete_invoice` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-invoice.md
- `delete_item` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-item.md
- `delete_location` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-location.md
- `delete_lock_rule` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-lock-rule.md
- `delete_order` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-order.md
- `delete_payment` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-payment.md
- `delete_project` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-project.md
- `delete_property` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-property.md
- `delete_purchase_order` — Destructive — https://policylayer.com/tools/sankahq-sanka-mcp/delete-purchase-order.md
- …and 318 more: https://policylayer.com/tools/sankahq-sanka-mcp.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=sankahq-sanka-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/sankahq-sanka-mcp
