Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
- eddie/test-01-26-2026
pull_request:
branches:
- main
Expand All @@ -29,30 +28,17 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: "3.12"

- name: Install dependencies
run: |
python3 -m pip install -U requests
python3 -m pip install outerbounds pyyaml
python3 -m pip install -U ob-project-utils
run: pip install outerbounds ob-project-utils

- name: Configure Outerbounds
run: |
PROJECT_NAME=$(yq .project obproject.toml)
DEFAULT_CICD_USER="${PROJECT_NAME//_/-}-cicd"
PLATFORM=$(yq .platform obproject.toml)
CICD_USER=$(yq ".cicd_user // \"$DEFAULT_CICD_USER\"")
PERIMETER="default"
echo "🏗️ Deployment target:"
echo " Platform: $PLATFORM"
echo " CI/CD User: $CICD_USER"
echo " Perimeter: $PERIMETER"
outerbounds service-principal-configure \
--name $CICD_USER \
--deployment-domain $PLATFORM \
--perimeter $PERIMETER \
--from-obproject-toml \
--github-actions

- name: Deploy Project
Expand All @@ -62,4 +48,4 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
PYTHONUNBUFFERED: 1
run: obproject-deploy
run: obproject-deploy
39 changes: 39 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Flow Chaining Example (flow_chaining_demo)

Minimal example demonstrating two patterns for chaining flows:
`@project_trigger(event=...)` for event-based triggering with payload,
and `@trigger_on_finish(flow=...)` for direct flow completion chaining.

## Platform Features Used

- **Events**: `ProjectEvent("start_training")` published from PreprocessFlow, consumed by TrainFlow via `@project_trigger`
- **Apps**: Trigger app in `deployments/trigger-app/` for firing events from a UI

## Flows

| Flow | Trigger | Purpose |
|------|---------|---------|
| PreprocessFlow | Manual | Parallel dataset processing via `foreach`, publishes `start_training` event |
| TrainFlow | @project_trigger(start_training) | Receives event payload as Parameters, runs training |

## Key Pattern

PreprocessFlow publishes a `ProjectEvent("start_training")` with payload.
TrainFlow's `@project_trigger(event="start_training")` maps payload keys to
`Parameter` names (e.g., `processed_paths`). This is the recommended approach
over `@trigger_on_finish` when you need to pass data via event payload.

## Run Locally

```bash
cd flow-chaining-example
python flows/preprocess/flow.py run --datasets "path1,path2,path3"
python flows/train/flow.py run --learning_rate 0.05 --n_estimators 200
```

## Common Pitfalls

- Event payload values map to Parameters by name; `processed_paths` is sent as JSON string and parsed in the flow
- `@project_trigger` is branch-scoped (events only trigger flows on the same branch)
- TrainFlow cannot access upstream artifacts when triggered by event (unlike `@trigger_on_finish` which exposes `current.trigger.run.data`)
- The README describes `@trigger_on_finish` but the actual code uses `@project_trigger` -- the event-based pattern was adopted later
Loading