
{
"createTime": 1759861689504,
"updateTime": 1759861689504,
"name": "ProcessTransaction",
"description": "Processes a financial transaction",
"version": 1,
"tasks": [
{
"name": "GetAccountInfo",
"taskReferenceName": "GetAccountInfo",
"inputParameters": {
"llmProvider": "Gemini",
"model": "gemini-2.0-flash",
"promptName": "ExtractAccountInfo",
"promptVariables": {
"accountSummary": "${workflow.input.accountSummary}"
}
},
"type": "LLM_TEXT_COMPLETE",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false
},
{
"name": "switch",
"taskReferenceName": "switch_ref",
"inputParameters": {
"switchCaseValue": ""
},
"type": "SWITCH",
"decisionCases": {
"switch_case": [
{
"name": "FraudDetection",
"taskReferenceName": "FraudDetection",
"inputParameters": {
"transaction": "${workflow.input.transactionInfo}",
"account": "${GetAccountInfo.output.response}"
},
"type": "SIMPLE",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false
}
]
},
"defaultCase": [
{
"name": "ProcessPayment",
"taskReferenceName": "ProcessPayment",
"inputParameters": {
"transaction": "${workflow.input.transactionInfo}",
"account": "${GetAccountInfo.output.response}"
},
"type": "SIMPLE",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false
}
],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"evaluatorType": "value-param",
"expression": "switchCaseValue",
"onStateChange": {},
"permissive": false
},
{
"name": "SendNotification",
"taskReferenceName": "SendNotification",
"inputParameters": {
"account": "${GetAccountInfo.output.response}"
},
"type": "SIMPLE",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false
}
],
"inputParameters": [
"accountSummary",
"transactionInfo"
],
"outputParameters": {},
"failureWorkflow": "",
"schemaVersion": 2,
"restartable": true,
"workflowStatusListenerEnabled": false,
"ownerEmail": "test@example.com",
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 0,
"variables": {},
"inputTemplate": {},
"enforceSchema": true,
"metadata": {},
"maskedFields": []
}



















@tool
def check_balance(account_id: str) -> dict:
"""Check the balance of a bank account."""
return {"account_id": account_id, "balance": 5432.10, "currency": "USD"}
@tool
def lookup_order(order_id: str) -> dict:
"""Look up the status of an order."""
return {"order_id": order_id, "status": "shipped", "eta": "2 days"}
billing = Agent(
name="billing",
model="openai/gpt-4o",
instructions="Handle billing questions: balances, payments, invoices.",
tools=[check_balance],
)
orders = Agent(
name="orders",
model="openai/gpt-5",
instructions="Handle order questions: status, shipping, returns.",
tools=[lookup_order],
)
support = Agent(
name="support",
model="openai/gpt-4o",
instructions="Route each request to the right specialist.",
agents=[billing, orders],
strategy=Strategy.HANDOFF,
)
with AgentRuntime() as runtime:
result = runtime.run(support, "What's the balance on account ACC-123?")
result.print_result()import io.orkes.conductor.client.ApiClient;
import io.orkes.conductor.client.ApiException;
import io.orkes.conductor.client.api.WorkflowApi;
import io.orkes.conductor.client.model.StartWorkflowRequest;
import io.orkes.conductor.client.model.StartWorkflowResponse;
public class WorkflowExecutor {
public static void main(String[] args) {
ApiClient client = new ApiClient();
client.setBasePath("https://api.orkes.io");
client.setApiKey("YOUR_API_KEY");
WorkflowApi api = new WorkflowApi(client);
StartWorkflowRequest request = new StartWorkflowRequest();
request.setName("ai-agent-workflow");
request.setVersion(1);
request.setInput(null);
try {
StartWorkflowResponse response = api.startWorkflow(request);
System.out.println("Workflow started successfully with ID: " + response.getWorkflowId());
} catch (ApiException e) {
System.err.println("Error starting workflow: " + e.getMessage());
}
}
}const checkBalance = tool(
async (args: { accountId: string }) => ({
account_id: args.accountId,
balance: 5432.10,
currency: 'USD',
}),
{
name: 'check_balance',
description: 'Check the balance of a bank account.',
inputSchema: {
type: 'object',
properties: { accountId: { type: 'string', description: 'The account ID' } },
required: ['accountId'],
},
},
);
const lookupOrder = tool(
async (args: { orderId: string }) => ({
order_id: args.orderId,
status: 'shipped',
eta: '2 days',
}),
{
name: 'lookup_order',
description: 'Look up the status of an order.',
inputSchema: {
type: 'object',
properties: { orderId: { type: 'string', description: 'The order ID' } },
required: ['orderId'],
},
},
);
const billing = new Agent({
name: 'billing',
model: 'openai/gpt-4o',
instructions: 'Handle billing questions: balances, payments, invoices.',
tools: [checkBalance],
});
const orders = new Agent({
name: 'orders',
model: 'openai/gpt-5',
instructions: 'Handle order questions: status, shipping, returns.',
tools: [lookupOrder],
});
const support = new Agent({
name: 'support',
model: 'openai/gpt-4o',
instructions: 'Route each request to the right specialist.',
agents: [billing, orders],
strategy: 'handoff',
});
const runtime = new AgentRuntime();
try {
const result = await runtime.run(support, "What's the balance on account ACC-123?");
result.printResult();
} finally {
await runtime.shutdown();
}using Conductor.Api;
using Conductor.Client;
using Conductor.Client.Authentication;
using Conductor.Client.Models;
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
var configuration = new Configuration
{
BasePath = "https://api.orkes.io",
AuthenticationSettings = new OrkesAuthenticationSettings(
keyId: "YOUR_KEY_ID",
keySecret: "YOUR_KEY_SECRET"
)
};
var executor = new WorkflowExecutor(configuration);
var request = new StartWorkflowRequest
{
Name = "ai-agent-workflow",
Version = 1,
Input = new Dictionary<string, object>
{
{ "userId", "123" },
{ "message", "Run AI agent" }
}
};
var workflowId = executor.StartWorkflow(request);
Console.WriteLine($"Started workflow with ID: {workflowId}");
}
}import { ConductorClient, WorkflowExecutor } from '@io-orkes/conductor-javascript'
const client = new ConductorClient({
serverUrl: 'https://api.orkes.io',
keyId: process.env.KEY_ID,
keySecret: process.env.KEY_SECRET
})
const workflowExecutor = new WorkflowExecutor(client)
const result = await workflowExecutor.startWorkflow({
name: 'ai-agent-workflow',
version: 1,
input: {
userId: '123',
message: 'Run AI agent'
}
})
console.log('Workflow started:', result.workflowId)






























































































