hooks/generate-from-data
Hook Generation — data-driven hook ideas from scraped intelligence + strategy context.
Category: hooks
Source: workflows/hooks/generate.py
Input Schema
Section titled “Input Schema”| Field | Type | Default | Description |
|---|---|---|---|
classified_hooks | object[] | — | Pre-scraped hooks with engagement data |
clusters | object[] | — | Hook archetype clusters |
competitors | string[] | — | Competitor creator names/handles |
lookahead_days | integer | 30 | How far ahead to look for events |
niche | string | "" | Content niche (e.g. ‘AI tools’, ‘fitness’) |
num_hooks | integer | 15 | Number of hook ideas to generate |
platform | string | "tiktok" | Target platform |
regenerate | object | — | When set, this run is a regeneration. Workflows may read direction / keep / extra_instructions to modulate prompts; the engine persists parent_run_id and parent_variant_index as run lineage columns. |
variants | integer | 1 | Number of independent variant executions (1–10). When > 1, the engine runs the workflow N times with different sampling, producing N outputs. |
Output Schema
Section titled “Output Schema”| Field | Type | Default | Description |
|---|---|---|---|
hook_ideas | object[] | — | Generated hook ideas |
kind | object | — | Variant card shape: video / carousel / image / text. Surfaced on the per-variant entry of the run-output API and used by gallery UIs to pick the right layout. |
workflow | string | "hook-generation" | Workflow identifier |
Task Pipeline
Section titled “Task Pipeline”gather_competitor_insights → generate_hook_ideas| Task | Description |
|---|---|
gather_competitor_insights | Aggregate competitor hook intelligence — delegates to SDK stage. |
generate_hook_ideas | Generate hook ideas — delegates to SDK stage (70/20/10 strategy, PromptExtension). |
Run-spec example
Section titled “Run-spec example”Save the YAML below as my-run.yaml, edit the values, and run with the CLI or POST it to the API. Required fields are uncommented; optional knobs are documented above the input: block — copy any line under input: and uncomment to set.
workflow: hooks/generate-from-data
# Optional fields — copy any line(s) under `input:` and uncomment to set:# Pre-scraped hooks with engagement data# classified_hooks: []## Hook archetype clusters# clusters: []## Competitor creator names/handles# competitors: []## How far ahead to look for events# lookahead_days: 30## Content niche (e.g. 'AI tools', 'fitness')# niche: ""## Number of hook ideas to generate# num_hooks: 15## Target platform# platform: tiktok#
input: {}Run it locally:
fab-workflow --from-file my-run.yamlOr submit over the wire — the same file is the request body:
curl -X POST 'https://gofabric.dev/v1/workflows/runs?name=hooks/generate-from-data' \ -H 'Authorization: Bearer fab_xxx' \ -H 'content-type: application/yaml' \ --data-binary @my-run.yamlEvery workflow also accepts the universal WorkflowInput fields — variants (1–10 fan-out) and regenerate (creative-direction hints with run lineage). See Run-specs (YAML / TOML / JSON) for the full top-level shape (metadata, priority, bundle, parent, etc.).
Warnings
Section titled “Warnings”- Task
gather_competitor_insightshas no Pydantic types — contract is opaque to consumers. - Task
generate_hook_ideashas no Pydantic types — contract is opaque to consumers.