xiaohongshu
xiaohongshu
flow-create-scenario-files
Create scenario files for testing migrated Output SDK workflows. Use to set up test inputs in the scenarios/ subfolder.
Full skill instructions
This skill helps create scenario files - JSON files containing test inputs for Output SDK workflows. Scenario files enable consistent testing and validation of migrated workflows.
After Migration:
During Development:
Scenario files live in a scenarios/ subfolder within the workflow directory:
src/workflows/my_workflow/
├── workflow.ts
├── steps.ts
├── types.ts
├── [email protected]
└── scenarios/
├── basic_input.json
├── edge_case_empty.json
└── full_options.json
Scenario files are JSON files that match the workflow's input schema:
{
"userId": "user-123",
"options": {
"includeDetails": true,
"maxResults": 10
}
}
Use descriptive names that indicate the test case:
basic_input.json # Standard happy path
edge_case_empty.json # Empty or minimal input
edge_case_large.json # Large data input
error_missing_field.json # Missing required field (for error testing)
full_options.json # All optional fields included
question_ada_lovelace.json # Specific test scenario description
Use the Output CLI to run a workflow with a scenario file:
# Basic usage
npx output workflow run <workflow_name> --input src/<workflow>/scenarios/<scenario>.json
# Examples
npx output workflow run simple --input src/simple/scenarios/question_ada_lovelace.json
npx output workflow run userReport --input src/workflows/user_report/scenarios/basic_input.json
Review the workflow's input schema in types.ts or workflow.ts:
// types.ts
export const WorkflowInputSchema = z.object( {
userId: z.string(),
reportType: z.enum( [ 'daily', 'weekly', 'monthly' ] ),
options: z.object( {
includeCharts: z.boolean().optional(),
maxPages: z.number().optional()
} ).optional()
} );
mkdir -p src/workflows/my_workflow/scenarios
Start with a minimal valid input:
{
"userId": "test-user-001",
"reportType": "daily"
}
Full Options Scenario:
{
"userId": "test-user-001",
"reportType": "weekly",
"options": {
"includeCharts": true,
"maxPages": 5
}
}
Edge Case - Empty Optional:
{
"userId": "test-user-002",
"reportType": "monthly",
"options": {}
}
If the Flow SDK workflow had test files, convert them to scenarios:
// Original test
describe('UserReportWorkflow', () => {
it('generates daily report', async () => {
const input = {
userId: 'test-123',
reportType: 'daily'
};
const result = await workflow.execute(input);
expect(result.success).toBe(true);
});
});
// scenarios/daily_report.json
{
"userId": "test-123",
"reportType": "daily"
}
Run with:
npx output workflow run userReport --input src/workflows/user_report/scenarios/daily_report.json
Test normal, expected usage:
// scenarios/basic_user.json
{
"userId": "user-12345",
"action": "process"
}
Test boundary conditions:
// scenarios/edge_empty_string.json
{
"userId": "",
"action": "validate"
}
// scenarios/edge_long_input.json
{
"userId": "user-12345",
"content": "Very long content string repeated many times..."
}
Test error handling (may cause expected failures):
// scenarios/error_invalid_type.json
{
"userId": 12345,
"action": "process"
}
Test complex inputs:
// scenarios/complex_nested.json
{
"userId": "user-001",
"documents": [
{
"id": "doc-1",
"title": "First Document",
"content": "Content of first document"
},
{
"id": "doc-2",
"title": "Second Document",
"content": "Content of second document"
}
],
"options": {
"processAll": true,
"outputFormat": "json"
}
}
// types.ts
import { z } from '@output.ai/core';
export const AnalyzeDocumentInputSchema = z.object( {
documentId: z.string(),
documentText: z.string(),
analysisType: z.enum( [ 'summary', 'entities', 'sentiment', 'full' ] ),
options: z.object( {
language: z.string().optional(),
maxLength: z.number().optional(),
includeConfidence: z.boolean().optional()
} ).optional()
} );
scenarios/basic_summary.json:
{
"documentId": "doc-001",
"documentText": "This is a sample document about artificial intelligence and its applications in modern business.",
"analysisType": "summary"
}
scenarios/full_analysis_with_options.json:
{
"documentId": "doc-002",
"documentText": "Detailed technical document content here...",
"analysisType": "full",
"options": {
"language": "en",
"maxLength": 500,
"includeConfidence": true
}
}
scenarios/edge_minimal.json:
{
"documentId": "doc-min",
"documentText": "Short.",
"analysisType": "summary"
}
scenarios/edge_empty_options.json:
{
"documentId": "doc-003",
"documentText": "Document with empty options object.",
"analysisType": "entities",
"options": {}
}
# Test basic scenario
npx output workflow run analyzeDocument --input src/workflows/analyze_document/scenarios/basic_summary.json
# Test full options
npx output workflow run analyzeDocument --input src/workflows/analyze_document/scenarios/full_analysis_with_options.json
# Test edge cases
npx output workflow run analyzeDocument --input src/workflows/analyze_document/scenarios/edge_minimal.json
Use this template to create new scenarios:
{
"_scenario": {
"name": "Descriptive scenario name",
"description": "What this scenario tests",
"expectedOutcome": "success|error|specific behavior"
},
"field1": "value1",
"field2": "value2",
"optionalField": "optional value"
}
Note: The _scenario metadata field is optional and ignored by the workflow. It's useful for documentation.
After creating scenarios, verify they work:
# List all scenarios
ls src/workflows/my_workflow/scenarios/
# Run each scenario
for f in src/workflows/my_workflow/scenarios/*.json; do
echo "Testing: $f"
npx output workflow run my_workflow --input "$f"
done
flow-validation-checklist - Complete migration validationflow-analyze-workflow-structure - Understanding workflow inputsflow-conventions-folder-structure - Folder structure conventionsxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience