Recued
Menu
← Back to recipes

Add a tag

by recued-core v3 6 views

Use “Add a tag” in Recued. Adds a tag anywhere in your tree, at any depth. The tag and its place in the tree are written together or not at all.

Complete workflow

Ledger book 16 pinned recipes

Use Ledger book in Recued for accounting, double entry, budget, and records. It includes 44 built-in actions and 15 ready-to-run workflows. Actions that change data use Recued's approval controls.

You are viewing one recipe in this workflow. Installing it opens the complete pack so its other recipes and background automations arrive together.

Add a tag
This recipe

Use “Add a tag” in Recued. Adds a tag anywhere in your tree, at any depth. The tag and its place in the tree are written together or not at all.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “The accounts” in Recued. Every account with its id — what you post to, and what anything else in this workflow needs before it can name one.

pack:ledger-bookaccountingaccountsrecords
by recued-core pinned v3

Use “The tags” in Recued. Every tag with its id and how deep it sits — the trees you can spend against, and the ids the rest of the pack takes.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “What it all comes to” in Recued. Each currency's balance read exactly, then converted at rates you give and added up.

pack:ledger-bookaccountingcurrencyrecords
by recued-core pinned v3

Use “Every budget at once” in Recued. All your budgets for a period, each counting everything under its tag — in four queries, however many budgets you have.

pack:ledger-bookaccountingbudgetrecords
by recued-core pinned v3
Show all 16 recipes

Use “How a budget is doing” in Recued. What a budget has left, counting everything under its tag at any depth.

pack:ledger-bookaccountingbudgetrecords
by recued-core pinned v3

Use “What went under a tag” in Recued. Everything spent under one tag, including every tag beneath it, at any depth.

pack:ledger-bookaccountingtagsbudget
by recued-core pinned v3

Use “The lines under a tag” in Recued. Every transaction line under a tag and everything beneath it — the lines themselves, not a total. With a CSV to copy.

pack:ledger-bookaccountingtagsexport
by recued-core pinned v3

Use “Open an account” in Recued. Adds an account to your chart. Its currency is fixed here and every line posted to it inherits it.

pack:ledger-bookaccountingrecordsv2
by recued-core pinned v2

Use “Post an entry” in Recued. One entry, any number of legs, written in a single all-or-nothing transaction. It will not post unless the legs sum to zero.

pack:ledger-bookaccountingdouble-entryrecords
by recued-core pinned v3

Use “Tag a month of lines” in Recued. One tree at a time: every line in a period on one page, with a picker in the tag cell.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “Tag a transaction line” in Recued. Sets which tags a line belongs to, one per tree. Each tag and every tag above it counts the full amount.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “Set a budget” in Recued. A cap on a tag for one period. It counts everything under that tag, at any depth.

pack:ledger-bookaccountingbudgetrecords
by recued-core pinned v3

Use “Move a tag” in Recued. Puts a tag inside a different one. Everything recorded under it follows automatically — no transaction is rewritten.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “Delete a tag” in Recued. Removes a tag and everything beneath it. Refuses while anything is still tagged with it.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3
View pack details, dependencies, and permissions →

Depth is not a setting

Nest as deep as you like. Nothing in the schema knows how many levels there are, because the tree is not stored as levels — it is stored as which tags contain which, one row per ancestor.

Adding a tag costs one write per ancestor, not one per tag in the tree. A tag four levels down writes five rows whatever the tree weighs. The alternative — numbering the tree left-to-right — makes every insert renumber everything to its right, which is a bulk update this substrate deliberately does not offer.

The tag and its edges land together. They go through core.records.batch, so there is no moment where a tag exists outside the tree. A tag with no edges is invisible to every rollup — it would look like a tag you never spent anything under, which is exactly the wrong thing for it to look like.

Trees are dimensions

A tag belongs to exactly one tree and keeps it for good. person -> department -> division -> corp is one tree; a project tree and a client tree are others, and a transaction carries at most one tag from each.

That is what makes the whole thing add up. Money tagged to a person is fully that person's, fully their department's and fully their division's — the same money, looked at from further out. Nothing is split, so a query at any level of any tree is a plain sum and needs no reconciliation afterwards.

The root is set here and never changes. Moving a tag WITHIN its tree is move-tag; moving it to a different tree is not a move at all — it is a different classification, and everything tagged under it would mean something else.

Why the money never moves

Spending points at a tag, never at its position. So when you reorganise later, the totals follow automatically and not one recorded transaction is rewritten. That is the whole reason the tree is stored this way rather than as a path like /life/home/kitchen/: a path has to be copied onto every tagged transaction to be useful, and then moving one tag rewrites thousands of rows.

Limits worth knowing

A rollup reads at most 100 tags beneath a node. Under any tag you would actually budget on, that is not close. If you have more than 100 tags under one node, ask about a narrower one — or, for the whole book, read the accounts instead, which needs no tag at all.

How it works 26 steps

Inspect the data fetches, transforms, gates, and output this recipe runs.

Process (26 steps)
tag_id trim
Trim whitespace from setting id
name trim
Trim whitespace from setting name
parent_id trim
Trim whitespace from setting parent id
inputs_ok all
Check if all conditions are true
inputs_guard guard
Stop if inputs ok equals
existing ?
taken compare
Check if existing record id has data
taken_guard guard
Stop if taken equals
has_parent compare
Check if parent id has data
parent ?
skip: step.has_parent equal false
parent_found compare
Check if parent record id has data
parent_missing all
Check if all conditions are true
parent_guard guard
Stop if parent missing equals
ancestors ?
skip: step.has_parent equal false
ancestor_rows default
Apply default
ancestor_count count
Count items in ancestor rows
batch_fits compare
Check if ancestor count is at most 98
size_guard guard
Stop if batch fits equals
root_ref ternary
Apply ternary
tag_op default
Apply default
self_op default
Apply default
ancestor_ops map
Extract from each item
ops flatten
Flatten nested lists in
post ?
edge_count count
Count items in ops
card to_summary
Format results as a summary card
Settings 3 configurable

Configurable at install. Defaults shown — change them anytime in Recued.

id setting = [object Object]
name setting = [object Object]
parent id setting =

About

Tags

pack:ledger-bookaccountingtagsrecordsv3

Details

26 steps 3 configurable settings recipe_id: add-tag