Skip to content

outerbounds/http-event-trigger-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trigger a Metaflow flow via HTTP

Fire events at deployed Metaflow flows with curl.

Setup

1. Configure Outerbounds (one-time, requires Python):

pip install outerbounds
outerbounds configure <config-string-from-ui>
# or for CI: outerbounds service-principal-configure --name ... --deployment-domain ...

2. Extract webhook credentials:

python extract_credentials.py        # writes WEBHOOK_URL and AUTH_KEY to .env

3. Deploy the flow:

python flows/webhook_receiver/flow.py argo-workflows create

4. Fire an event:

source .env
curl -X POST "$WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $AUTH_KEY" \
  -d '{
    "payload": {
      "name": "incoming_webhook",
      "id": "'$(uuidgen | tr A-Z a-z)'",
      "timestamp": '$(date +%s)',
      "utc_date": "'$(date -u +%Y%m%d)'",
      "generated-by-metaflow": false,
      "record_count": 77
    }
  }'

A 200 means the event was accepted and the flow will run.

SDK alternatives (with automatic token refresh)

For long-lived apps, use a library instead of raw curl:

Both accept the awssm-arn:... config string from the UI and handle token refresh automatically.

Related docs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages