Examples
The examples/ directory at the repository root contains complete workflow OCI artifacts
ready to build, push, and run. Each example is a self-contained directory with a CWL
workflow, a Dockerfile, and a Taskfile for building and pushing.
Catalog
user-inputs
Minimal workflow that accepts a text message and a file attachment, then logs the message.
Exercises the yr:Log step class and trigger-input schema extraction.
class: yr:Workflow
inputs:
message: { type: string }
attachment: { type: File }
steps:
log_message:
run: { class: yr:Log }
in: { message: message }
Features: yr:Log, string + File inputs, input schema extraction
image-caption
Multi-step workflow that takes a photo and a caption string, inverts the image colors with ImageMagick, then overlays the caption text onto the result.
class: yr:Workflow
inputs:
photo: { type: File }
caption: { type: string }
outputs:
result: { type: File, outputSource: caption_image/result }
steps:
invert_image:
run: { class: CommandLineTool, dockerPull: dpokidov/imagemagick:latest }
caption_image:
run: { class: CommandLineTool, dockerPull: dpokidov/imagemagick:latest }
in: { image: invert_image/inverted, text: caption }
Features: CommandLineTool with DockerRequirement, inter-step file passing, File
outputs, multi-step DAG
connector-slack
Posts a text message to a Slack channel via the typed Slack connector class.
$namespaces:
slack: "https://yardrail.com/cwl/slack#"
class: yr:Workflow
steps:
send:
run:
class: slack:ChatPostMessageWithFormdataBody
inputs:
channel: string
text: string
outputs:
ts: string
channel: string
in:
channel: channel
text: message
out: [ts, channel]
Features: typed connector class (slack:ChatPostMessageWithFormdataBody), structured outputs
Requires: a configured Slack integration in the target org
connector-notion
Queries a Notion database and returns its metadata (object type, title, properties).
$namespaces:
notion: "https://yardrail.com/cwl/notion#"
class: yr:Workflow
steps:
get_db:
run:
class: notion:RetrieveADatabase
inputs:
databaseId: string
outputs:
object: string
title: Any
properties: Any
in:
databaseId: { default: "2b5dab68476742adaed70b730659a34e" }
out: [object, title, properties]
Features: typed connector class (notion:RetrieveADatabase), Notion connector
Requires: a configured Notion integration; update the databaseId default for your
workspace
human-approval
Drafts a summary, suspends for a human to review it, then continues once approved. The
review step's input is the drafted summary; the downstream ExpressionTool step receives
the decision output.
class: yr:Workflow
steps:
draft:
run: { class: ExpressionTool }
out: [summary]
approve:
label: "Review the order summary"
run:
class: yr:HumanApproval
eventType: "order.review"
timeout: "PT48H"
instructions: "Check the order count matches the shop dashboard, then approve."
in: { summary: draft/summary }
out: [decision]
after:
run: { class: ExpressionTool }
in: { decision: approve/decision }
Features: yr:HumanApproval, suspend/resume, ExpressionTool with
InlineJavascriptRequirement, inter-step data flow
agent-summarize
LLM agent that sends a text prompt to the configured inference backend and returns the model's summary. No tools — single-turn completion.
class: yr:Workflow
inputs:
prompt: { type: string }
outputs:
summary: { type: string, outputSource: summarize/text }
steps:
summarize:
run:
class: yr:Agent
system: "You are a concise summarizer. Respond with only the summary, no preamble."
in: { prompt: prompt }
out: [text]
Features: yr:Agent, inference, string I/O
Requires: a configured inference backend in the target org
agent-with-tools
Multi-turn agent that can call Slack during its reasoning loop. Demonstrates typed connector class references as agent tools.
$namespaces:
slack: "https://yardrail.com/cwl/slack#"
class: yr:Workflow
steps:
agent:
run:
class: yr:Agent
system: "You are a helpful assistant with access to Slack."
tools:
- class: slack:ChatPostMessageWithFormdataBody
in: { prompt: prompt }
out: [text]
Features: yr:Agent with tool calling, typed connector class tool reference
Requires: configured inference backend and Slack integration
agent-notion-research
Multi-turn research agent with manually-defined Notion tools. Reads pages, queries databases, and writes a summary back to a target page.
class: yr:Workflow
steps:
researcher:
run:
class: yr:Agent
system: "You are a research assistant with access to a Notion workspace."
maxTurns: 10
tools:
- name: retrieve-page-markdown
description: "Read the markdown content of a Notion page"
connector: notion
function: retrieve-page-markdown
parameters:
properties:
pageId: { type: string }
required: [pageId]
- name: query-data-source
description: "Query a Notion database"
connector: notion
function: query-data-source
parameters:
properties:
dataSourceId: { type: string }
required: [dataSourceId]
in: { prompt: prompt }
out: [text]
Features: yr:Agent with manual tool definitions, maxTurns, multi-tool agent
Requires: configured inference backend and Notion integration
publish-to-site
Generates an HTML report with a CommandLineTool step, then publishes it to a site via
yr:PublishToSite.
class: yr:Workflow
inputs:
target_site: { type: string }
outputs:
published_version: { type: string, outputSource: publish/version_id }
steps:
generate:
run:
class: CommandLineTool
requirements:
DockerRequirement: { dockerPull: alpine:3 }
out: [report]
publish:
run:
class: yr:PublishToSite
in: { site_id: target_site }
out: [version_id]
Features: yr:PublishToSite, CommandLineTool → site publish pipeline
Requires: a configured site in the target org
Building an example
Each example has its own Taskfile.yml:
cd examples/connector-slack
task build # docker build → OCI artifact
task push # docker push → configured registry
After pushing, the registry scan picks up the artifact and it appears in the org's workflow template catalog. Install it from the UI or API, bind the required connectors, and trigger a run.