-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Proposal: GNAP as a coordination layer between Prefect workflows and autonomous AI agents
Prefect is excellent for orchestrating data pipelines — scheduling, retries, caching, event-based automations. As AI agents become first-class participants in data workflows, you need a protocol for Prefect flows to hand off tasks to agents and receive results back.
GNAP (Git-Native Agent Protocol) provides exactly this bridge. A git repo serves as the coordination board: Prefect writes tasks to board/todo/, agents claim to board/doing/, and commit results to board/done/. Prefect can watch for done signals via its event-based automation system.
Applied to Prefect's data pipeline + AI agent workflow:
# In a Prefect flow
@task
def create_gnap_task(batch_id: str):
# Write task spec to board/todo/
gnap_write(f"board/todo/analyze-batch-{batch_id}.md", spec)
@task
def wait_for_gnap_result(batch_id: str):
# Prefect task polls board/done/ or uses file-system event
return gnap_wait(f"board/done/analyze-batch-{batch_id}.md")The AI agent (could be any framework — LangChain, Claude Code, custom) handles the task autonomously. Prefect orchestrates the overall workflow; GNAP handles the agent coordination.
This is especially compelling for Prefect's event-based automation — a gnap.task.completed event could trigger downstream Prefect flows, creating a clean interface between deterministic pipelines and autonomous agents.
Prefect's existing concept of Work Pools and Workers maps naturally — GNAP could be a new Worker type that processes tasks from a GNAP board.