$ cat workspace-template.yaml

[

[TEMPLATE] PMESII2

// Sistema di analisi documentale PMESII versione 2 - A partire da un folder o un documento, esegue analisi di tipo Politico, Militare, Infrastrutturale, Informativo, Economico, Sociale e Ambientale.

Document Generation

// Canvas Preview

canvas.flow

// Instruction

instruction.md

PMESII Analysis (Pre-Built)

Template ID

66846b43-db04-48b1-9c9c-bc4c0db8b8de

Overview

A ready-to-run 7-domain PMESII intelligence-analysis pipeline. All chains and wiring already exist — the agent's only job is to point it at the user's source document, subject, and output folder, then run save-file to produce one consolidated .md report. Do NOT clone, rebuild, or rewire anything — the build is already done.

This template is already built — do NOT rebuild

  • The 7 PMESII domains are pre-wired into Make Array - Merge all Content: item_0=Political, item_1=Military, item_2=Economic, item_3=Social, item_4=Infrastructure, item_5=Information, item_6=Environmental.
  • Each chain (Insert → Merge → Summarizer) is fully connected to its domain preset prompt, the subject, and the document. The 7 Analysis prompt [X] presets are already authored.
  • Source is single-file (Document Reader only — there is no Drive Folder Reader).
  • The 3 inputs ship with demo values (Document Reader = a sample file, Geopolitical Actor = "Regia Marina", save-file = a sample folder). Those IDs will NOT exist in a fresh workspace — replace all three with the user's, or the run fails (404 / 422).

Workflow Chain

"Document Reader"[content] ─┐  (feeds all 7 Summarizers)"Geopolitical Actor"[value]─┤  (subject, feeds all 7 Insert nodes)   For each domain X (Political…Environmental):     "Analysis prompt [X]" + subject → Insert → Merge → "Summarizer - X" → Make Array[item_n]"Make Array - Merge all Content"[items] → "save-file"[text]  → .md report (LOCAL — run this)                                        → "Public Share"[content] → public /s/{slug} (NEVER auto-run)

Nodes the agent configures (only these)

  • "Document Reader"driveItemId = the source document ID. (Demo value present — replace it.)
  • "Geopolitical Actor" (Text) — value = the subject/entity to analyze. (Demo = "Regia Marina".)
  • "save-file"destinationFolder = a Drive folder ID (REQUIRED — the demo folder won't exist → 422), optional name (default output_example_pmesii.md). Terminal node — LOCAL write, run it.
  • "Public Share" — optional public /s/{slug} link. Externally visible — NEVER auto-run; offer only on explicit request.
  • Everything else (7 chains, presets, Make Array) is pre-wired — do NOT touch.

Execution Strategy

You MUST complete both phases in order: Phase 1 → Phase 2. This template is already built — never clone or rebuild it.

Tool rule for inputs: the source file and the output folder are chosen with the Drive location picker selectDriveItem (the file/folder browser) — NOT with requestUserDecision/preset options. Only the subject (free text) uses requestUserDecision. Never ask the user to type or paste a Drive ID by hand.

Drive the tools yourself — do NOT punt to chat. Collect all three inputs by CALLING the tools in sequence within THIS turn (selectDriveItem for file → requestUserDecision for subject → selectDriveItem for folder), then continue to execution. The tools pause for the user on their own. Do NOT write a plain-chat message like "forniscimi il documento, il soggetto e la cartella" and end your turn — a prose question that stops the build is a FAILURE (the pipeline never runs). Even when the user's request gives no file/subject/folder (e.g. just "crea un'analisi PMESII"), proceed straight into the pickers.

Fallback guard (CRITICAL) — applies to BOTH the source-file AND the output-folder question; they must behave identically: if you ask for a file/folder via requestUserDecision (e.g. selectDriveItem is unavailable), you MUST set allowFreeText: true so there is ALWAYS an open field where the user can type a name to search — then resolve it with searchDriveItems. Suggested files/folders may be added as options, but they are EXTRA choices, never the only ones, and keep them FEW (≤4 top matches) — the open field renders as the LAST option, so a long suggestion list buries it and the user can't find where to type (observed on an 8-option source-file prompt that felt like it had no open answer). NEVER allowFreeText: false for a file/folder question.

Phase 1: Configure the three inputs

  1. applyCanvasDataIMMEDIATELY commit the template. After this, use nodeFinder for all IDs. Recognize the pipeline is pre-built (7 Summarizer - X nodes + a wired Make Array) — do NOT clone or rebuild.
  2. Source document — use the Drive file picker. Call selectDriveItem (type=file) so the user browses and picks the document — this is the file/folder location tool, NOT a requestUserDecision with options, and never a hand-typed ID. (If the user already gave a file reference in chat, use it directly; otherwise open the picker — optionally searchDriveItems first to seed it.) Then nodeFinder → "Document Reader"; upsertNode { driveItemId: "<selected file ID>" }. Replaces the demo file.
  3. Subject. Call requestUserDecision once, free-text (options: []), key "subject": question (Italian) "Quale soggetto o entità geopolitica vuoi analizzare con il framework PMESII?", context "Il soggetto viene inserito in tutti i 7 prompt PMESII." Read subject = answers.find(a=>a.key==="subject")?.otherText ?? ...selectedIds?.[0]. nodeFinder → "Geopolitical Actor"; upsertNode { value: subject }. (Do NOT keep the demo "Regia Marina" unless the user asks.)
  4. Output folder (REQUIRED) — use the Drive folder picker. Call selectDriveItem (type=folder) so the user browses and picks the destination folder. If you instead ask via requestUserDecision, it MUST have allowFreeText: true (an open field to type a folder name to search — then searchDriveItems it); you may add found folders as options, but NEVER allowFreeText: false. nodeFinder → "save-file"; upsertNode { destinationFolder: "<picked folder ID>", name: "pmesii_<subject-slug>.md" }. The demo destinationFolder won't exist here → save-file fails with 422, so always set a real, user-picked folder.
    • File name: derive name from the subject (step 3) so each report is identifiable — slugify the subject (lowercase, spaces/punctuation → hyphens) and use pmesii_<slug>.md. Example: subject "regia Marina" → name: "pmesii_regia-marina.md". This replaces the demo output_example_pmesii.md. (Do NOT try to add a date/time — the agent has no reliable clock; and re-running save-file upserts the SAME Drive item by node id, so the name identifies the analysis, it does not version it.)

Phase 1 complete. Now proceed to Phase 2.

Phase 2: Verify & run

  1. Quick nodeFinder sanity check (no rebuilding — just confirm inputs):
    • "Document Reader" driveItemId is set to the user's file (not the demo / not empty).
    • "Geopolitical Actor" value is the user's subject.
    • "save-file" destinationFolder is the user-chosen folder, and name is the subject-based pmesii_<slug>.md (not the demo output_example_pmesii.md).
    • "Make Array - Merge all Content" has 7 inbound pins item_0…item_6 (it should already — if any is missing, the snapshot is incomplete; flag it, do NOT rebuild silently).
  2. nodeExecutor"save-file". It auto-resolves the whole upstream DAG (Make Array → 7 Summarizers → chains → Document Reader). Wait for completion (no polling). Do NOT auto-run "Public Share".
  3. verification → audit checklist: the 3 inputs set, Make Array has 7 inputs, save-file executed (report written, with the file name). Use info ✓ / warning / error. Then followUp → summarize: 7 PMESII domains analyzed for "", report saved as .md; suggest next steps (change subject, change source, "esegui Public Share per un link pubblico").

Phase 2 complete.

Configuration Tips

User saysConfigure
"cambia soggetto" / "analizza "upsertNode "Geopolitical Actor" { value }, then re-run "save-file".
"usa questo file" / "cambia documento"selectDriveItem (file picker) → upsertNode "Document Reader" { driveItemId }, then re-run "save-file".
"salva in un'altra cartella"selectDriveItem (folder picker) → upsertNode "save-file" { destinationFolder }, then re-run. ("rinomina" → set { name }.)
"pubblica" / "condividi" / "link"nodeFinder → "Public Share" → nodeExecutor. Warn: public /s/{slug} URL. Explicit request only — never auto-run.

Error Handling

  • save-file fails with 422: source or output unset/invalid — almost always a leftover demo value. Confirm "Document Reader" driveItemId (user's file) and "save-file" destinationFolder (a real folder) are set, then re-run.
  • Empty / wrong report: the demo subject ("Regia Marina") or demo file was left in place. Set "Geopolitical Actor" value and "Document Reader" driveItemId to the user's, then re-run.
  • A domain section missing from the report: that Summarizer - XMake Array pin lost its edge — re-add with upsertEdge using the item_<n> from the chain list above. (Should not happen in this pre-built snapshot.)
  • Tempted to clone/rebuild: don't — every chain already exists. If a node is genuinely missing, add only that one with upsertNode/upsertEdge; never re-run a full build.

Cross-references

reference/INSTRUCTION_GUIDELINES.md · pmesii-analysis.md (the base/un-built template that DOES require the 6-chain build).

// Dependencies

requirements.py
1from input import DriveDocumentReader2from process import TextSummarizer3from input import Text4from process import TextMerge5from output import PublicShare6from process import MakeArray7from output import SaveFile

$ git log --oneline

v1.0.5
HEAD
2026-06-27
v1.0.42026-06-27
v1.0.32026-06-27
v1.0.22026-06-27
v1.0.12026-06-27
v1.0.02026-06-27