Docs/Recipes/Quarterly close

Run quarterly close.

The recipe one of our finance customers used to compress a six-day close into a 90-minute CFO review. The assistant pulls the numbers, drafts the narrative, and flags variances above your threshold. The CFO reviews and signs off.

One-time setup

  1. Connect the GL (NetSuite, QuickBooks, or generic CSV).
  2. Map your chart of accounts to the wrxstack Account hierarchy.
  3. Define a "variance threshold" doc that the assistant uses to decide what counts as worth flagging.
  4. Identify the named reviewer for sign-off (usually the CFO).

The workflow

[workflow]
name = "quarterly-close"

[trigger]
event = "schedule.quarterly"
cron  = "0 6 1 1,4,7,10 *"      # 6am, first of each quarter

[scope]
read  = ["finance:gl", "finance:budget", "documents:variance-policy"]
write = ["documents.create", "tasks.create"]

[approvals]
require = "role:cfo"

[[steps]]
name      = "pull"
tool      = "finance.pull_period"
input     = { period = "prior_quarter" }

[[steps]]
name      = "variance"
assistant = "variance-analyst"
input     = {
  actuals = "$steps.pull.actuals",
  budget  = "$steps.pull.budget",
  policy  = "doc_variance_policy",
}

[[steps]]
name = "draft"
tool = "documents.create"
input = {
  title  = "Q$steps.pull.quarter close review",
  body   = "$steps.variance.narrative",
  format = "markdown",
}

[[steps]]
name = "queue"
tool = "tasks.create"
input = {
  title    = "Sign off on Q$steps.pull.quarter close",
  assignee = "role:cfo",
  about    = ["$steps.draft.id"],
}

The narrative draft

The variance analyst is a custom assistant. It compares actuals to budget, applies your threshold policy, and writes a narrative in three sections: Top line, By line item, and Risks & questions for management. The narrative cites every figure to its source row in the GL pull.

The CFO review

The CFO opens one doc. Every variance has a "expand" affordance showing the underlying ledger rows. Comments are inline. Sign-off marks the task complete and writes a board-ready summary to a separate doc, ready for distribution.

Audit evidence

Every pull, every assistant step, every comment, and the final sign-off are in the audit log. External auditors can be granted a read-only audit role that sees the full chain of custody for the quarter.