17 of 50 in the Toggle pack

Decision Tree: Two Levels: Diagram element for AI agents

A question with two answers, each leading to two outcomes. The dot drops, splits to the two answer tags, splits again to four outcome switches, then the recommended outcome switches on..

  • 1:1native
  • 16:9native
  • 9:16native
  • 4:5native

Watermarked preview. The Toggle pack includes all 50 elements, clean and editable, in every size.

Paste this into Claude Code

Use the AgentFrames Toggle pack. Add a `decisionTree` beat to plan.json on a `lime` canvas with slots `question`, `a`, `b` and `pick` from my script. Then run validate → build → qa and show me qa/contact.jpg.

Variables

The slots your agent fills from your script, through plan.json.

SlotTypeWhat it holdsExample
questionstringquestion: {"type":"string","minLength":1,"maxLength":48}.Do people watch past 3 seconds?
astringa: JSON string. {"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":10},"leaves":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","minLength":1,"maxLength":14}}},"required":["label","leaves"]}.{"label":"Yes","leaves":["Keep the hook","Test payoff"]}
bstringb: JSON string. {"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":10},"leaves":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","minLength":1,"maxLength":14}}},"required":["label","leaves"]}.{"label":"No","leaves":["Rewrite line 1","Cut the intro"]}
pickenumpick: {"type":"string","enum":["none","a0","a1","b0","b1"]}.b0

What your agent can change

Decision Tree: Two Levels. Native 1920×1080, 8s at 30fps.

A question with two answers, each leading to two outcomes. The dot drops, splits to the two answer tags, splits again to four outcome switches, then the recommended outcome switches on.

Motion. Dot falls (ease-in); first branches draw as twin dots run (ease in-out); answer tags pop; second branches draw as four dots run; outcome switches pop; the picked switch flips on with one burst and the others dim. Why it moves. change: each split is a choice, and the switch shows where the advice lands.

Mount

Copy every manifest file into your project (plus af-toggle-runtime). Mount with a unique host id, data-composition-id="af-toggle-decision-tree-16x9", data-composition-src="compositions/af-toggle-decision-tree-16x9.html", data-duration="8" and data-variable-values. Use the variant whose size matches your project (16x9, 9x16, 4x5, 1x1): each is laid out natively, never scaled.

Content slots

Nested slots are JSON strings. Every slot is checked against constraints.json and measured against the layout before anything draws; the block stops with a message naming the slot and the fix (it never truncates or shrinks text).

  • question (required): {"type":"string","minLength":1,"maxLength":48}
  • a (required): {"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":10},"leaves":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","minLength":1,"maxLength":14}}},"required":["label","leaves"]}
  • b (required): {"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":10},"leaves":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","minLength":1,"maxLength":14}}},"required":["label","leaves"]}
  • pick: {"type":"string","enum":["none","a0","a1","b0","b1"]}
  • a is drawn on the left, b on the right. 16:9 spreads the four outcomes across; the other sizes stack each pair under its answer.

Style: colourway (lime, cobalt, coral), accent (optional hex), footer, ground: dark only, exit (slide or cut).

Timing

8s. Everything has landed by 4.8s (60%), then the scene holds for reading (the grid and the faint rings slow to a residual drift, text stays still) and slides out to the left in a motion blur over the last 0.5 s, leaving the empty ground.

Example

``json { "question": "Do people watch past 3 seconds?", "a": "{\"label\":\"Yes\",\"leaves\":[\"Keep the hook\",\"Test payoff\"]}", "b": "{\"label\":\"No\",\"leaves\":[\"Rewrite line 1\",\"Cut the intro\"]}", "pick": "b0" } ``

FAQ

What can my AI agent change in Decision Tree: Two Levels?

Your agent fills the question, a, b and pick slots through the block's data-variable-values (or the starter project's variables). Motion, timing, palette, fonts and the internal layout are protected, so the result keeps the Toggle look.

Which aspect ratios does Decision Tree: Two Levels support?

Decision Tree: Two Levels is designed natively for 16:9, 9:16, 4:5 and 1:1. A typical beat lasts 8s.

How do I get Decision Tree: Two Levels?

Decision Tree: Two Levels is included in the Toggle pack, which is part of the AgentFrames All-access subscription along with 49 other templates in this pack and every other pack on the store. You get the full source, the editing contracts and the agent instructions.

This is 1 of 50

Get the full Toggle pack

Decision Tree: Two Levels comes as part of Toggle: 50 elements, 4 starter videos and every size (16:9, 9:16, 4:5, 1:1), re-brandable to your colours in one file. Included in All-access with every other pack.

See the whole pack →

Wide (16:9) · 60s · made entirely with this pack

More in Toggle

See all 50 elements in Toggle →