Build product system (bill of quantities)
lca_compose_assemblyBuild a product system as a bill of quantities of database processes. Each member's amount is sent in one call. Structure only; no LCIA runs. The assembled product is the functional unit; each member is linked to its full upstream when assessed, so the total is a full-upstream figure for the declared scope, with a per-material breakdown. Takes inputs (flat) or stages (a DAG of life-cycle stages), not both. The system is validated against the database; if valid it is saved and system_ref is returned for lca_run_assessment. If invalid, the response lists errors[], missing_required[] and warnings[] and nothing is saved; a corrected call carries the complete system. dry_run: true validates without saving. A tool error, not an invalid result, means the engine is unavailable. Members are p<N> refs; UUIDs are not accepted. lca_compose_linked builds explicit supply edges instead. The product_system_authoring skill (load_skill) documents build order and common failures.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | System boundary. 'cradle_to_gate' (default) = materials through manufacture. 'cradle_to_grave' = ALSO include end-of-life (add disposal/treatment process leaves). 'end_of_life' = treatment of a product at end of life only; the functional unit is the treated product, e.g. '1 kg of end-of-life PV module, treated'. A cradle-to-grave system spans life-cycle phases — prefer `stages` over a flat `inputs` list so each phase gets its own subtotal. | |
| title | Yes | Name for the assembly, e.g. 'Wooden house assembly, 100 m²'. | |
| engine | No | Name of the engine database, as `lca_get(kind='engines')` lists it (case-insensitive). Omitted: this connection's default engine. | |
| inputs | No | FLAT bill of quantities: one entry per member. Use for a single cradle-to-gate group of parts with no phases to separate. If the system spans life-cycle phases (materials/transport/use/end-of-life) or is a comparison, prefer `stages` instead — same total, per-phase subtotals. Set this OR `stages`, not both. | |
| stages | No | MULTI-STAGE DAG (preferred for cradle-to-grave, multi-phase, or comparison systems — same total as a flat list, but each phase gets its own subtotal): named stages, each consuming process leaves and/or other stages. Declare stages + what each consumes; DO NOT wire links or name the final product — the compiler derives the edges and the final (sink) stage. Cycles are rejected. Set this OR `inputs`, not both. | |
| dry_run | No | When true, validate ONLY — return the envelope without persisting (and without a confirmation prompt). Default false: a valid system is built and its s-ref returned in this one call. | |
| workspace | Yes | Name of the workspace to work in, as `lca_get(kind='workspaces')` lists it (backticks optional). Named on every call: several conversations can share one connection, and each names its own workspace. The connection's default is often an empty sandbox rather than the user's work. | |
| output_name | Yes | Name for the assembled product, e.g. 'Wooden house, 100 m²'. | |
| output_unit | No | Declared unit for the assembled product (e.g. 'house', 'm2', 'tonne'). Used as the functional-unit unit in the scope editor. | |
| target_amount | No | Functional-unit amount (default 1.0). | |
| temporal_scope | No | Temporal scope of the system (e.g. '2020-2024', 'Reference year 2022'). | |
| cutoff_criteria | No | Explicit cutoff criteria (e.g. 'Mass cutoff 1%; energy cutoff 1%'). Overrides the scope-derived default. | |
| geographical_scope | No | Explicit geographical scope (e.g. 'Switzerland'). Overrides location codes derived from member processes. | |
| functional_unit_description | No | Free-text description of the functional unit (e.g. 'One house, 160 m², 50-year service life'). |