/outputai:output-error-direct-iofrom outputai
Diagnoses and fixes direct I/O in Output SDK workflow functions. Use when workflows hang, return undefined, or show 'workflow must be deterministic' errors from HTTP calls or database queries in workflow code.
Ships in outputai. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill helps diagnose and fix a critical error pattern where I/O operations (HTTP calls, database queries, file operations) are performed directly in workflow functions instead of in steps. This violates Temporal's determinism requirements.
You're seeing:
Workflow functions must be deterministic - they should only orchestrate steps, not perform I/O directly. When you make HTTP calls, database queries, or any external operations directly in a workflow function:
// WRONG: I/O directly in workflow
export default workflow( {
fn: async input => {
const response = await fetch( 'https://api.example.com/data' ); // BAD!
const data = await response.json();
return { data };
}
} );
// WRONG: Database I/O in workflow
export default workflow( {
fn: async input => {
const user = await db.users.findById( input.userId ); // BAD!
return { user };
}
} );
// WRONG: File I/O in workflow
import fs from 'fs/promises';
export default workflow( {
fn: async input => {
const data = await fs.readFile( input.path, 'utf-8' ); // BAD!
return { data };
}
} );
Move ALL I/O operations to step functions. Steps are designed to handle non-deterministic operations.
export default workflow( {
fn: async input => {
const response = await fetch( 'https://api.example.com/data' );
const data = await response.json();
return { data };
}
} );
import { z, step, workflow } from '@outputai/core';
import { createKyClient } from '@outputai/core/http';
// Create a step for the I/O operation
export const fetchData = step( {
name: 'fetchData',
inputSchema: z.object( {
endpoint: z.string()
} ),
outputSchema: z.object( {
data: z.unknown()
} ),
fn: async input => {
const client = createKyClient( { prefix: 'https://api.example.com' } );
const data = await client.get( input.endpoint ).json();
return { data };
}
} );
// Workflow only orchestrates steps
export default workflow( {
inputSchema: z.object( {} ),
outputSchema: z.object( { data: z.unknown() } ),
fn: async input => {
const result = await fetchData( { endpoint: 'data' } );
return result;
}
} );
export default workflow( {
fn: async input => {
const user = await prisma.user.findUnique( {
where: { id: input.userId }
} );
const orders = await prisma.order.findMany( {
where: { userId: input.userId }
} );
return { user, orders };
}
} );
import { z, step, workflow } from '@outputai/core';
import { prisma } from '../lib/db';
export const fetchUser = step( {
name: 'fetchUser',
inputSchema: z.object( { userId: z.string() } ),
outputSchema: z.object( {
user: z.object( {
id: z.string(),
name: z.string(),
email: z.string()
} ).nullable()
} ),
fn: async input => {
const user = await prisma.user.findUnique( {
where: { id: input.userId }
} );
return { user };
}
} );
export const fetchOrders = step( {
name: 'fetchOrders',
inputSchema: z.object( { userId: z.string() } ),
outputSchema: z.object( {
orders: z.array( z.object( {
id: z.string(),
total: z.number()
} ) )
} ),
fn: async input => {
const orders = await prisma.order.findMany( {
where: { userId: input.userId }
} );
return { orders };
}
} );
export default workflow( {
inputSchema: z.object( { userId: z.string() } ),
outputSchema: z.object( {
user: z.unknown(),
orders: z.array( z.unknown() )
} ),
fn: async input => {
const { user } = await fetchUser( { userId: input.userId } );
const { orders } = await fetchOrders( { userId: input.userId } );
return { user, orders };
}
} );
Search for common I/O patterns in workflow files:
# Find fetch calls
grep -rn "await fetch" src/workflows/
# Find axios calls
grep -rn "axios\." src/workflows/
# Find database operations
grep -rn "prisma\.\|db\.\|mongoose\." src/workflows/
# Find file system operations
grep -rn "fs\.\|readFile\|writeFile" src/workflows/
Then review each match to see if it's in a workflow function vs a step function.
Workflow functions should contain:
await myStep( input )Workflow functions should NOT contain:
After moving I/O to steps:
npx output workflow run <name> --input '<input>'npx output workflow debug <id>output-error-http-clientoutput-error-nondeterminismWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub growthxai/output --plugin outputai51 skills in this plugin
/output-build-workflowImplement an Output SDK workflow from a plan document. Use when the user asks to build, implement, or code a workflow from an existing plan, or after output-plan-workflow has produced a plan and the user is ready to build./output-credentials-editView, edit, and set encrypted credentials in an Output.ai project. Use when adding secrets, updating API keys, verifying credential values, or retrieving a specific credential./output-credentials-env-varsWire encrypted credentials to environment variables using the credential: convention. Use when setting up LLM provider keys (ANTHROPIC_API_KEY, OPENAI_API_KEY) or any env var that should come from encrypted credentials.Other plugins' skills for the same job