Simple Pull Request Workflow
This example shows how a Bosun task can create a file from user input and immediately open a draft pull request so reviewers see the change.
Workflow Definition (bosun.yaml)
name: create-file-and-pr-from-input
description: Creates a file with user-defined content and opens a draft pull request.
inputs:
fileName:
type: String
required: true
description: The name of the file to create (e.g., 'my-new-feature.md').
fileContent:
type: String
required: true
description: The content to write into the new file.
steps:
- id: create-file
name: Create a new file with provided content
agent:
extends: Coding
instructions: "Create a new file named '{{ inputs.fileName }}' in the root directory with the following content: '{{ inputs.fileContent }}'"
role: "You are a helpful assistant that creates files based on instructions."
constraints:
- "Ensure the file is created exactly as specified."
- "Do not make any other changes."
- id: open-pr
name: Create a draft pull request
agent:
extends: pull_request
instructions: "Create a draft pull request for the changes made in this run."
tools:
- name: update_pull_request
extends: create_or_update_pull_request
with:
draft: true
starts_with: create-file
ends_with: open-pr
edges:
- from: create-file
to: open-pr
How it Works
- Inputs: The workflow takes
fileNameandfileContent, so each run can target a new file and body. - Create File Step: The
create-fileagent uses{{ inputs.fileName }}and{{ inputs.fileContent }}to create the requested file. - Create Pull Request Step: The graph then follows the edge to
open-pr, where a dedicatedpull_requestagent creates a draft pull request. Thedraft: truesetting keeps the PR open for review or follow-up updates.