dotFactory Create account
All workflow ideas
When a pull request opens

Make a PR video demo

Inspect the diff and create a demo only when it changes the frontend. Backend-only changes skip video; frontend demos are uploaded to S3 and linked from the GitHub pull request.

Workflow

One decision · two possible paths
1
GitHub event
Pull request opened
2
Agent step
Classify changed files
Decision point
Do the changes affect the frontend?
Path 1

Frontend change

change is frontend
1Create demo
2Upload video to S3
3Comment S3 link on GitHub PR
Only this matching path runs
Path 2

Backend-only change

no frontend files
1Skip video
Only this matching path runs
Factory definition
.fct
type Repository = { name: text, url: text }
type PullRequest = { number: int, url: text }
type ChangeKind = choice {
  frontend { paths: [text] }
  backend_only { paths: [text] }
}
type Demo = { summary: text, video_url: text }
type Upload = { video_url: text }

trigger pull_request:
  kind: github
  config: {
    path: "/api/github/webhook"
    target: { one: { repo: "acme/app" } }
    actions: ["opened", "synchronize"]
  }
  out:
    pr: PullRequest
    commit: text
    repository: Repository
    base_ref: text

runner agent:
  kind: opencode
  in: open
  out: open

step inspect_changes:
  runner: agent
  in:
    prompt: "Inspect changed paths and classify as frontend or backend_only."
    repo: { url: pull_request.repository.url, ref: pull_request.commit }
    base: pull_request.base_ref
  out: { change: ChangeKind }

step create_demo:
  runner: agent
  when: inspect_changes.change is frontend
  in:
    prompt: "Create a short demo video of the frontend changes."
    repo: { url: pull_request.repository.url, ref: pull_request.commit }
    paths: inspect_changes.change.frontend.paths
  out: { demo: Demo }

step upload_video:
  kind: s3
  when: inspect_changes.change is frontend
  in: { video: create_demo.demo.video_url }
  out: { upload: Upload }

step link_video:
  runner: agent
  when: inspect_changes.change is frontend
  in:
    prompt: "Comment on the pull request with the uploaded demo link."
    pr: pull_request.pr
    video_url: upload_video.upload.video_url
  out: { comment_url: text }

step skipped:
  kind: file
  when: inspect_changes.change is backend_only
  config: { path: "out/video-skipped.json" }
  in: { reason: "No frontend changes; video generation skipped." }
Illustrative factory code. Connect the runner, repository access, and tools for your environment.