Skip to content

hooks/generate

Hook Generation — data-driven hook ideas from scraped intelligence + strategy context.

Category: hooks
Source: workflows/hooks/generate.py

FieldTypeDefaultDescription
classified_hooksobject[]Pre-scraped hooks with engagement data
clustersobject[]Hook archetype clusters
competitorsstring[]Competitor creator names/handles
lookahead_daysinteger30How far ahead to look for events
nichestring""Content niche (e.g. ‘AI tools’, ‘fitness’)
num_hooksinteger15Number of hook ideas to generate
platformstring"tiktok"Target platform
regenerateobjectWhen 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.
variantsinteger1Number of independent variant executions (1–10). When > 1, the engine runs the workflow N times with different sampling, producing N outputs.
FieldTypeDefaultDescription
hook_ideasobject[]Generated hook ideas
kindobjectVariant 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.
workflowstring"hook-generation"Workflow identifier
gather_competitor_insights → gather_trend_signals → gather_event_context → merge_intel → generate_hook_ideas
TaskDescription
gather_competitor_insightsAggregate competitor hook intelligence — delegates to SDK stage.
gather_trend_signalsPull in trend context — delegates to SDK stage.
gather_event_contextGather event context — delegates to SDK stage.
merge_intelMerge parallel competitor-insights and trend-signals branches.
generate_hook_ideasGenerate hook ideas — delegates to SDK stage (70/20/10 strategy, PromptExtension).

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
# 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:

Terminal window
fab-workflow --from-file my-run.yaml

Or submit over the wire — the same file is the request body:

Terminal window
curl -X POST 'https://gofabric.dev/v1/workflows/runs?name=hooks/generate' \
-H 'Authorization: Bearer fab_xxx' \
-H 'content-type: application/yaml' \
--data-binary @my-run.yaml

Every 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.).

  • Task gather_competitor_insights has no Pydantic types — contract is opaque to consumers.
  • Task gather_trend_signals has no Pydantic types — contract is opaque to consumers.
  • Task gather_event_context has no Pydantic types — contract is opaque to consumers.
  • Task merge_intel has no Pydantic types — contract is opaque to consumers.
  • Task generate_hook_ideas has no Pydantic types — contract is opaque to consumers.