Documentation

modelriver callback

Finish event-driven flows after listen receives task.ai_generated. Post enriched data back to ModelRiver without writing curl by hand.

Overview

Event-driven workflows pause after AI generation and wait for your backend to call callback_url. The callback command lets you complete that step from the terminal while testing with the CLI.

Usage

Bash
# Using channel ID from trigger/listen output
modelriver callback \
--channel-id abc-123-def \
--data '{"summary":"Escalated to auth","priority":"high"}' \
--task-id TCK-10042
 
# Using the full callback URL from the webhook payload
modelriver callback \
--callback-url "https://api.modelriver.com/v1/callback/abc-123-def" \
--data '{"summary":"Escalated to auth"}'
 
# Full payload JSON
modelriver callback \
--channel-id abc-123-def \
--payload '{"data":{"summary":"Done"},"task_id":"TCK-1","metadata":{"processed_by":"cli"}}'

Options

OptionDescription
--channel-id <id>Channel ID from trigger / listen
--callback-url <url>Full callback URL from webhook payload
--data <json>Callback data object JSON
--payload <json>Full callback body JSON
--task-id <id>Optional task ID
--metadata <json>Optional metadata object JSON

Typical event-driven test flow

Bash
# Terminal 1
modelriver listen --print
 
# Terminal 2
modelriver trigger --workflow my-event-workflow --message "Test" --print-channel
 
# After listen shows task.ai_generated:
modelriver callback --channel-id CHANNEL_ID --data '{"enriched":true}'

Next steps