Class: CreateWorkflowTool
Defined in: packages/agentos/src/cognition/emergent/CreateWorkflowTool.ts:175
ITool implementation enabling agents to compose, execute, and list multi-step tool workflows at runtime.
Example
const tool = new CreateWorkflowTool({
config: { maxSteps: 10, allowedTools: ['web_search', 'summarize'] },
executeTool: (name, args) => orchestrator.execute(name, args),
listTools: () => orchestrator.listToolNames(),
});
// Create a workflow
const createResult = await tool.execute({
action: 'create',
name: 'search-and-summarize',
description: 'Search the web and summarize results.',
steps: [
{ tool: 'web_search', args: { query: '$input' } },
{ tool: 'summarize', args: { text: '$prev' } },
],
}, context);
Implements
ITool<CreateWorkflowInput>
Constructors
Constructor
new CreateWorkflowTool(
deps):CreateWorkflowTool
Defined in: packages/agentos/src/cognition/emergent/CreateWorkflowTool.ts:251
Create a new CreateWorkflowTool.
Parameters
deps
CreateWorkflowDeps
Injected dependencies including config, tool executor, and tool lister.
Returns
CreateWorkflowTool
Properties
category
readonlycategory:"emergent"='emergent'
Defined in: packages/agentos/src/cognition/emergent/CreateWorkflowTool.ts:191
Optional
Optional. A category or group to which this tool belongs (e.g., "data_analysis", "communication", "file_system", "image_generation"). This is useful for organizing tools, for filtering in UIs or registries, and potentially for aiding an LLM in selecting from a large set of tools.
Implementation of
description
readonlydescription:string
Defined in: packages/agentos/src/cognition/emergent/CreateWorkflowTool.ts:186
A detailed, natural language description of what the tool does, its primary purpose, typical use cases, and any important considerations or limitations for its use. This description is critical for an LLM to understand the tool's capabilities and make informed decisions about when and how to invoke it. It should be comprehensive enough for the LLM to grasp the tool's semantics.
Implementation of
displayName
readonlydisplayName:"Create Workflow"='Create Workflow'
Defined in: packages/agentos/src/cognition/emergent/CreateWorkflowTool.ts:183
A concise, human-readable title or display name for the tool. Used in user interfaces, logs, or when presenting tool options to developers or users.
Example
"Web Search Engine", "Advanced Python Code Interpreter"
Implementation of
hasSideEffects
readonlyhasSideEffects:true=true
Defined in: packages/agentos/src/cognition/emergent/CreateWorkflowTool.ts:194
Optional
Optional. Indicates if the tool might have side effects on external systems
(e.g., writing to a database, sending an email, making a purchase, modifying a file).
Defaults to false if not specified. LLMs or orchestrators might handle tools with side effects
with greater caution, potentially requiring explicit user confirmation.
Implementation of
id
readonlyid:"com.framers.emergent.create-workflow"='com.framers.emergent.create-workflow'
Defined in: packages/agentos/src/cognition/emergent/CreateWorkflowTool.ts:177
A globally unique identifier for this specific tool (e.g., "web-search-engine-v1.2", "stock-price-fetcher").
This ID is used for internal registration, management, and precise identification.
It's recommended to use a namespaced, versioned format (e.g., vendor-toolname-version).
Implementation of
inputSchema
readonlyinputSchema:JSONSchemaObject
Defined in: packages/agentos/src/cognition/emergent/CreateWorkflowTool.ts:197
The JSON schema defining the structure, types, and constraints of the input arguments object that this tool expects. This schema is used by:
- LLMs: To construct valid argument objects when requesting a tool call.
ToolExecutor: For validating the arguments before invoking the tool'sexecutemethod.ToolExecutorreads it as JSON Schema draft-07, coercing an argument to the type the schema names where it can and filling in adefaultthe schema gives. A call to a tool whose input schema does not compile fails, and the tool does not run.
See
Implementation of
name
readonlyname:"create_workflow"='create_workflow'
Defined in: packages/agentos/src/cognition/emergent/CreateWorkflowTool.ts:180
The functional name of the tool, as it should be presented to and used by an LLM in a tool call request (e.g., "searchWeb", "executePythonCode", "getWeatherForecast"). This name must be unique among the set of tools made available to a given GMI/LLM at any time. It should be concise, descriptive, and typically in camelCase or snake_case.
Implementation of
Methods
execute()
execute(
args,context):Promise<ToolExecutionResult<any>>
Defined in: packages/agentos/src/cognition/emergent/CreateWorkflowTool.ts:279
Execute the requested workflow action.
Parameters
args
CreateWorkflowInput
Action type and associated parameters.
context
Tool execution context.
Returns
Promise<ToolExecutionResult<any>>
A ToolExecutionResult wrapping the action outcome.
Implementation of
refusalBeforeApproval()
refusalBeforeApproval(
args,context):ToolExecutionResult<any> |undefined
Defined in: packages/agentos/src/cognition/emergent/CreateWorkflowTool.ts:266
The learning layer's refusal of a create, before the approval gate: storing a workflow is a self-change, and
running or listing one is not.
Parameters
args
Record<string, any>
The call's arguments.
context
The call's context.
Returns
ToolExecutionResult<any> | undefined