### Start Python Worker Source: https://orkes.io/content/quickstarts/write-workers Set up a virtual environment, install dependencies, and run the Python worker script. Ensure you have Python 3 installed. ```bash python3 -m venv venv source venv/bin/activate pip3 install -r requirements.txt python3 main.py ``` -------------------------------- ### Run Python Quickstart Source: https://orkes.io/content/sdks/python Execute the Python script to start the worker and run the workflow. ```bash python quickstart.py ``` -------------------------------- ### Get Conductor Go SDK Source: https://orkes.io/content/sdks/golang Install the Orkes Conductor Go SDK using the `go get` command. ```bash go get github.com/conductor-sdk/conductor-go ``` -------------------------------- ### Get Schedule Response Example Source: https://orkes.io/content/reference-docs/api/schedule/get-schedule This is an example of a successful response when retrieving schedule details. It includes the schedule's configuration, timing, and metadata. ```json { "name": "assignPRSchedule", "cronExpression": "0 0 ? * *", "runCatchupScheduleInstances": false, "paused": true, "startWorkflowRequest": { "name": "github_pr_reviewer_assignment", "correlationId": "", "input": {}, "taskToDomain": {}, "priority": 0, "idempotencyKey": "123", "idempotencyStrategy": "RETURN_EXISTING" }, "zoneId": "Asia/Dubai", "scheduleStartTime": 1770354000000, "scheduleEndTime": 1774933200000, "createTime": 1770118062620, "updatedTime": 1770118646394, "createdBy": "john.doe@acme.com", "updatedBy": "john.doe@acme.com", "description": "Schedule for automating PR assignment workflow.", "orgId": "0000", "queueMsgId": "assignPRSchedule" } ``` -------------------------------- ### Python Quickstart Workflow Source: https://orkes.io/content/sdks/python Defines a simple 'greet' worker, a 'greetings' workflow, registers them, starts the worker, executes the workflow, and prints the result and execution URL. Ensure your environment variables are set for SDK configuration. ```python from conductor.client.automator.task_handler import TaskHandler from conductor.client.configuration.configuration import Configuration from conductor.client.orkes_clients import OrkesClients from conductor.client.workflow.conductor_workflow import ConductorWorkflow from conductor.client.worker.worker_task import worker_task @worker_task(task_definition_name='greet', register_task_def=True) def greet(name: str) -> str: return f'Hello {name}' def main(): config = Configuration() clients = OrkesClients(configuration=config) executor = clients.get_workflow_executor() workflow = ConductorWorkflow(name='greetings', version=1, executor=executor) greet_task = greet(task_ref_name='greet_ref', name=workflow.input('name')) workflow >> greet_task workflow.output_parameters({'result': greet_task.output('result')}) workflow.register(overwrite=True) with TaskHandler(configuration=config, scan_for_annotated_workers=True) as task_handler: task_handler.start_processes() run = executor.execute(name='greetings', version=1, workflow_input={'name': 'Conductor'}) print(f'Result: {run.output["result"]}') print(f'Execution: {config.ui_host}/execution/{run.workflow_id}') if __name__ == '__main__': main() ``` -------------------------------- ### Quickstart Workflow Implementation Source: https://orkes.io/content/sdks/javascript Defines a 'greet' worker, initializes Orkes clients, registers a 'greetings' workflow, starts workers, executes the workflow, and logs the result. Ensure your environment variables are set for OrkesClients.from() to work. ```typescript import { OrkesClients, TaskHandler, worker, ConductorWorkflow, simpleTask, } from "@io-orkes/conductor-javascript"; import type { Task } from "@io-orkes/conductor-javascript"; class Workers { @worker({ taskDefName: "greet" }) async greet(task: Task) { const name = task.inputData?.name ?? "World"; return { status: "COMPLETED" as const, outputData: { result: `Hello ${name}` } }; } } const main = async () => { const clients = await OrkesClients.from(); const executor = clients.getWorkflowClient(); const workflow = new ConductorWorkflow(executor, "greetings") .add(simpleTask("greet_ref", "greet", { name: "${workflow.input.name}" })) .outputParameters({ result: "${greet_ref.output.result}" }); await workflow.register(); void new Workers(); // instantiating the class triggers the decorators const handler = new TaskHandler({ client: clients.getClient(), scanForDecorated: true }); await handler.startWorkers(); const run = await workflow.execute({ name: "Conductor" }); console.log(`Result: ${run.output?.result}`); console.log(`Execution: https://developer.orkescloud.com/execution/${run.workflowId}`); await handler.stopWorkers(); }; main(); ``` -------------------------------- ### Get All Services Response Example Source: https://orkes.io/content/reference-docs/api/remote-services/get-all-services This is an example of the JSON response you will receive when successfully retrieving all services. It includes details such as service name, type, URI, methods, and circuit breaker configuration. ```json [ { "name": "petstore", "type": "HTTP", "serviceURI": "https://petstore.swagger.io/v2/swagger.json", "methods": [], "config": { "circuitBreakerConfig": { "failureRateThreshold": 50, "slidingWindowSize": 100, "minimumNumberOfCalls": 100, "waitDurationInOpenState": 1000, "permittedNumberOfCallsInHalfOpenState": 100, "slowCallRateThreshold": 50, "slowCallDurationThreshold": 100, "automaticTransitionFromOpenToHalfOpenEnabled": true, "maxWaitDurationInHalfOpenState": 1 } }, "circuitBreakerEnabled": false, "servers": [ { "url": "https://petstore.swagger.io/v2/swagger.json", "type": "OPENAPI_SPEC" } ] }, { "name": "grpcbin", "type": "gRPC", "serviceURI": "grpcb.in:9000", "methods": [], "config": { "circuitBreakerConfig": { "failureRateThreshold": 50, "slidingWindowSize": 100, "minimumNumberOfCalls": 100, "waitDurationInOpenState": 1000, "permittedNumberOfCallsInHalfOpenState": 100, "slowCallRateThreshold": 50, "slowCallDurationThreshold": 100, "automaticTransitionFromOpenToHalfOpenEnabled": true, "maxWaitDurationInHalfOpenState": 1 } }, "circuitBreakerEnabled": false, "servers": [] } ] ``` -------------------------------- ### Fetch Service Endpoints Source: https://orkes.io/content/reference-docs/api/remote-services/discover-service-endpoints This example demonstrates how to fetch a list of all available service endpoints using a GET request. It includes authentication headers and a query parameter to potentially create endpoints if they don't exist. ```APIDOC ## GET /api/registry/service/{serviceName}/discover ### Description Fetches a list of all available service endpoints for a given service. The `create` query parameter can be used to create endpoints if they do not exist. ### Method GET ### Endpoint `/api/registry/service/{serviceName}/discover` ### Query Parameters - **create** (boolean) - Optional - If true, creates endpoints if they do not exist. ### Headers - **accept**: `application/json` - **X-Authorization**: `` - Required - Authentication token. ### Request Example ```curl curl -X 'GET' \ 'https:///api/registry/service/petstore/discover?create=true' \ -H 'accept: application/json' \ -H 'X-Authorization: ' ``` ### Response #### Success Response (200) Returns a JSON array of service endpoint objects. Each object contains: - **operationName** (string): The name of the operation. - **methodName** (string): The endpoint path. - **methodType** (string): The HTTP method (e.g., GET, POST, PUT, DELETE). - **inputType** (string): The name of the input type for the request. - **outputType** (string): The name of the output type for the response. - **requestParams** (array): An array of request parameters, including path, query, and header parameters. - **requestContentType** (string): The content type of the request. - **responseContentType** (string): The content type of the response. - **deprecated** (boolean): Indicates if the endpoint is deprecated. - **description** (string): A brief description of the endpoint's functionality. #### Response Example ```json [ { "operationName": "uploadFile", "methodName": "/pet/{petId}/uploadImage", "methodType": "POST", "inputType": "uploadFile_Request", "outputType": "ApiResponse", "requestParams": [ { "name": "petId", "type": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestContentType": "multipart/form-data", "responseContentType": "application/json", "deprecated": false } // ... other endpoints ] ``` ``` -------------------------------- ### Start Workflow Asynchronously with cURL Source: https://orkes.io/content/reference-docs/api/workflow/start-workflow-execution This example demonstrates how to start a workflow execution asynchronously using cURL. It includes setting the server URL, workflow name, priority, authorization token, content type, and the request body with workflow inputs. ```curl curl -X 'POST' \ 'https:///api/workflow/DemoWorkflow?priority=0' \ -H 'accept: text/plain' \ -H 'X-Authorization: ' \ -H 'Content-Type: application/json' \ -d '{"input1": "someValue"}' ``` -------------------------------- ### Example Workflow Definition Response (Full) Source: https://orkes.io/content/reference-docs/api/metadata/get-all-workflow-definitions This is an example of a complete workflow definition response, including all task details. ```json { "createTime": 0, "updateTime": 1735802256013, "name": "api-test", "description": "Sample workflow created using API", "version": 1, "tasks": [ { "name": "event", "taskReferenceName": "event_ref", "inputParameters": {}, "type": "EVENT", "decisionCases": {}, "defaultCase": [], "forkTasks": [], "startDelay": 0, "joinOn": [], "sink": "sqs:internal_event_name", "optional": false, "defaultExclusiveJoinTask": [], "asyncComplete": false, "loopOver": [], "onStateChange": {}, "permissive": false } ], "inputParameters": [], "outputParameters": {}, "failureWorkflow": "", "schemaVersion": 2, "restartable": false, "workflowStatusListenerEnabled": false, "ownerEmail": "john.doe@acme.com", "timeoutPolicy": "ALERT_ONLY", "timeoutSeconds": 0, "variables": {}, "inputTemplate": {}, "enforceSchema": true, "metadata": {} } ``` -------------------------------- ### Install JavaScript SDK and TypeScript Tooling Source: https://orkes.io/content/sdks/javascript Install the necessary packages for the Conductor JavaScript SDK and TypeScript development. ```bash npm install @io-orkes/conductor-javascript npm install --save-dev typescript tsx ``` -------------------------------- ### Start Frontend Server Source: https://orkes.io/content/tutorials/agentic-interview-app Start the Next.js frontend server using npm run dev. This will launch the interactive chat UI for the interview. ```bash npm run dev ``` -------------------------------- ### Create Virtual Environment and Activate Source: https://orkes.io/content/sdks/python Set up a virtual environment for the Python SDK. Activate it before installing packages. ```bash python3 -m venv conductor source conductor/bin/activate ``` -------------------------------- ### Get Human Task Details Source: https://orkes.io/content/reference-docs/api/human-tasks/get-conductor-task-by-human-task-id This example demonstrates how to retrieve the details of a human task using its ID via a GET request. ```APIDOC ## GET /api/human/tasks/{humanTaskId}/conductorTask ### Description Retrieves the details of a human task using its unique ID. ### Method GET ### Endpoint /api/human/tasks/{humanTaskId}/conductorTask ### Parameters #### Path Parameters - **humanTaskId** (string) - Required - The unique identifier of the human task. #### Headers - **accept** (string) - Optional - Specifies the accepted response format, typically 'application/json'. - **X-Authorization** (string) - Required - The authentication token for accessing the API. ### Response #### Success Response (200) - **taskType** (string) - The type of the task (e.g., "HUMAN"). - **status** (string) - The current status of the task (e.g., "IN_PROGRESS"). - **inputData** (object) - A JSON object containing the input data for the human task. - **referenceTaskName** (string) - The reference name of the task within the workflow. - **retryCount** (integer) - The number of times the task has been retried. - **seq** (integer) - The sequence number of the task in the workflow. - **pollCount** (integer) - The number of times the task has been polled. - **taskDefName** (string) - The name of the task definition. - **scheduledTime** (integer) - The timestamp when the task was scheduled. - **startTime** (integer) - The timestamp when the task started execution. - **endTime** (integer) - The timestamp when the task ended execution. - **updateTime** (integer) - The timestamp when the task was last updated. - **startDelayInSeconds** (integer) - The delay in seconds before the task starts. - **retried** (boolean) - Indicates if the task has been retried. - **executed** (boolean) - Indicates if the task has been executed. - **callbackFromWorker** (boolean) - Indicates if the task requires a callback from the worker. - **responseTimeoutSeconds** (integer) - The timeout in seconds for the task response. - **workflowInstanceId** (string) - The ID of the workflow instance. - **workflowType** (string) - The type of the workflow. - **taskId** (string) - The unique ID of the task. - **callbackAfterSeconds** (integer) - The number of seconds after which a callback should occur. - **outputData** (object) - A JSON object containing the output data of the task. - **workflowTask** (object) - An object containing details about the workflow task definition. ### Request Example ```bash curl -X 'GET' \ 'https:///api/human/tasks/52e8b4b3-02a1-11f1-913a-226156badb04/conductorTask' \ -H 'accept: application/json' \ -H 'X-Authorization: ' ``` ### Response Example ```json { "taskType": "HUMAN", "status": "IN_PROGRESS", "inputData": { "paperUrl": "documents.pdf", "__humanTaskProcessContext": { "state": "ASSIGNED", "lastUpdated": 1770302732960, "humanTaskTriggerLog": [], "humanTaskActionLogs": [ { "id": "8a2ee7b2-cc98-4b37-b727-77086f365fe1", "state": "ASSIGNED", "stateStart": 1770302732960, "assignee": { "userType": "CONDUCTOR_USER", "user": "john.doe@acme.com" }, "action": "ASSIGNMENT", "actedBy": "system" } ], "assigneeIndex": 0, "skippedAssigneeIndexes": [], "assignmentsCompleted": false }, "comments": "", "__humanTaskDefinition": { "assignments": [ { "slaMinutes": 1, "assignee": { "userType": "CONDUCTOR_USER", "user": "john.doe@acme.com" } }, { "slaMinutes": 0, "assignee": { "userType": "EXTERNAL_USER", "user": "bob" } } ], "userFormTemplate": { "name": "LoanApproval", "version": 1 }, "assignmentCompletionStrategy": "LEAVE_OPEN", "displayName": "LoanApproval" }, "approve": "", "monthly_debt": 1100, "loan_amount": 80000, "employment_status": "employment-doc.pdf", "_createdBy": "john.doe@acme.com", "annual_income": 75000, "payment_history": "bank-statement.pdf" }, "referenceTaskName": "human_ref", "retryCount": 0, "seq": 4, "pollCount": 0, "taskDefName": "human", "scheduledTime": 1770302732923, "startTime": 1770302732916, "endTime": 0, "updateTime": 1770302732968, "startDelayInSeconds": 0, "retried": false, "executed": false, "callbackFromWorker": true, "responseTimeoutSeconds": 0, "workflowInstanceId": "51ee75ce-02a1-11f1-913a-226156badb04", "workflowType": "LoanApprovalWorkflow", "taskId": "52e8b4b3-02a1-11f1-913a-226156badb04", "callbackAfterSeconds": 0, "outputData": {}, "workflowTask": { "name": "human", "taskReferenceName": "human_ref", "inputParameters": { "__humanTaskDefinition": { "assignmentCompletionStrategy": "LEAVE_OPEN", "assignments": [ { "assignee": { "user": "john.doe@acme.com", "userType": "CONDUCTOR_USER" }, "slaMinutes": 1 }, { "assignee": { "user": "bob", "userType": "EXTERNAL_USER" }, "slaMinutes": 0 } ], "displayName": "LoanApproval", "userFormTemplate": { "name": "LoanApproval", "version": 1 } }, "loan_amount": "${workflow.input.loan_amount}", "annual_income": "${workflow.input.annual_income}", "monthly_debt": "${workflow.input.monthly_debt}", "employment_status": "${workflow.input.employment_status}", "payment_history": "${workflow.input.payment_history}", "paperUrl": "${workflow.input.documents}", "approve": "", "comments": "" }, "type": "HUMAN", "decisionCases": {}, "defaultCase": [], "forkTasks": [], "startDelay": 0, "joinOn": [], "optional": false, "taskDefinition": { "createTime": 1721640240094, "updateTime": 1721640240094, "createdBy": "john.doe@acme.com", "updatedBy": "john.doe@acme.com", "name": "human", "description": "generic human task", "retryCount": 3, "timeoutSeconds": 3600, "inputKeys": [], "outputKeys": [], "timeoutPolicy": "TIME_OUT_WF", "retryLogic": "FIXED", "retryDelaySeconds": 60, "responseTimeoutSeconds": 600, "concurrentExecLimit": 0, "inputTemplate": {}, "rateLimitPerFrequency": 0, "rateLimitFrequencyInSeconds": 1, "ownerEmail": "john.doe@acme.com", "pollTimeoutSeconds": 3600, "backoffScaleFactor": 1, "totalTimeoutSeconds": 0, "enforceSchema": false }, "defaultExclusiveJoinTask": [], "asyncComplete": false, "loopOver": [], "onStateChange": {}, "permissive": false }, "rateLimitPerFrequency": 0, "rateLimitFrequencyInSeconds": 0, "workflowPriority": 0, "iteration": 0 } ``` -------------------------------- ### Create Webhook Example Source: https://orkes.io/content/reference-docs/api/webhooks/create-webhook This example demonstrates how to create a webhook. Ensure you have the necessary authentication and provide the correct event type and callback URL. ```json { "name": "My Webhook", "event": "workflow.completed", "callbackUrl": "https://example.com/callback", "createdBy": "john.doe@acme.com" } ``` -------------------------------- ### Workflow Execution Response Example Source: https://orkes.io/content/reference-docs/api/workflow/start-workflow-execution This is an example of the response received after successfully starting a workflow execution asynchronously. It contains the unique workflow execution ID. ```text 86e6cce1-0599-11f1-913a-226156badb04 ``` -------------------------------- ### Response Example for Get Tags Source: https://orkes.io/content/reference-docs/api/environment-variables/get-tags-from-environment-variable This is an example of the JSON response when successfully retrieving tags for an environment variable. The response is an array of key-value tag objects. ```json [ { "key": "backend", "value": "PR" }, { "key": "dev", "value": "automation" } ] ``` -------------------------------- ### Create Project Directory Source: https://orkes.io/content/sdks/javascript Create a new folder for your project and navigate into it. ```bash mkdir conductor-app cd conductor-app ``` -------------------------------- ### Workflow Input Parameters (Case 3) Source: https://orkes.io/content/reference-docs/system-tasks/business-rule Example input parameters for a different case, demonstrating a 'laptop' product category with 'FIRE_FIRST' execution strategy. ```json { "productType": "electronics", "productCategory": "laptop", ``` -------------------------------- ### String Starts With Operator Source: https://orkes.io/content/reference-docs/system-tasks/business-rule Checks if a string begins with a specified substring. Available since v5.2.3 and v4.1.72. Example matches product names starting with 'iPhone'. ```plaintext productName startsWith "iPhone" ``` -------------------------------- ### Workflow Input Parameters Example Source: https://orkes.io/content/reference-docs/operators/get-workflow Example input parameters for running a workflow that uses the Get Workflow task. The 'workflowId' should be replaced with the actual ID of the workflow to retrieve. ```json { "workflowId": "8440b876-e7c5-11f0-a0ca-c60c4ebc4813"// Replace with your workflow ID } ``` -------------------------------- ### Start Backend Server Source: https://orkes.io/content/tutorials/agentic-interview-app Navigate to the 'workflow' directory and start the Python backend server using 'app.py'. The server typically runs on http://localhost:5000. ```bash cd workflow python app.py ``` -------------------------------- ### Example Response for Get Tags Source: https://orkes.io/content/reference-docs/api/tags/get-tags-from-workflow-definition This is an example of the JSON response you will receive when successfully retrieving tags for a workflow definition. It returns an array of tag objects, each with a key and a value. ```json [ { "key": "environment", "value": "testing" } ] ``` -------------------------------- ### Initialize Project with Module Type Source: https://orkes.io/content/sdks/javascript Set up a new Node.js project to use ES modules. ```bash npm init -y npm pkg set type=module ``` -------------------------------- ### Example Response for Get Schedules by Tag Source: https://orkes.io/content/reference-docs/api/schedule/get-schedules-using-tags This is an example of the JSON response you will receive when successfully retrieving schedules by tag. It includes details of the matching schedules and their associated tags. ```json [ { "tags": [ { "key": "team", "value": "docs" } ], "name": "assignPR", "cronExpression": "0 * * ? * *", "runCatchupScheduleInstances": false, "paused": true, "startWorkflowRequest": { "name": "github_pr_reviewer_assignment", "version": 2, "correlationId": "", "input": {}, "taskToDomain": {}, "priority": 0 }, "zoneId": "UTC", "createTime": 1748866217788, "updatedTime": 1765195763230, "createdBy": "john.doe@acme.com", "updatedBy": "john.doe@acme.com", "description": "Sample scheduler for running workflow every 2 mins", "orgId": "0000", "queueMsgId": "assignPR" } ] ``` -------------------------------- ### Run the Quickstart Script Source: https://orkes.io/content/sdks/javascript Execute the TypeScript file using tsx to run the workflow. ```bash npx tsx quickstart.ts ``` -------------------------------- ### Example Response for Get User Form Source: https://orkes.io/content/reference-docs/api/human-tasks/get-task-ui-template This is an example of the JSON response you will receive when successfully retrieving a user form template. It includes schema definitions and UI layout elements. ```json { "createTime": 1740572078291, "updateTime": 1768558337481, "createdBy": "USER:john.doe@acme.com", "updatedBy": "USER:john.doe@acme.com", "name": "Approval", "version": 1, "jsonSchema": { "$schema": "http://json-schema.org/draft-07/schema", "properties": { "paperUrl": { "type": "string" }, "approve": { "type": "string", "enum": [ "Yes", " No" ] }, "comments": { "type": "string" } }, "required": [ "approve", "comments" ] }, "templateUI": { "type": "VerticalLayout", "elements": [ { "type": "VerticalLayout", "elements": [ { "type": "Control", "scope": "#/properties/paperUrl", "label": "Review doc", "options": { "readonly": true } } ] }, { "type": "Control", "scope": "#/properties/approve", "label": "Approve document", "options": {} }, { "type": "Control", "scope": "#/properties/comments", "label": "Comments" } ] } } ``` -------------------------------- ### Setup Logging Source: https://orkes.io/content/sdks/golang Configure SDK logging using logrus. Sets the formatter to TextFormatter, output to stdout, and level to DebugLevel. ```go func init() { log.SetFormatter(&log.TextFormatter{}) log.SetOutput(os.Stdout) log.SetLevel(log.DebugLevel) } ``` -------------------------------- ### Get All Webhooks Response Example Source: https://orkes.io/content/reference-docs/api/webhooks/get-all-webhooks This is an example of the JSON response you will receive when successfully retrieving all webhook definitions. It includes details for each webhook, such as its name, ID, source platform, and execution history. ```json [ { "name": "Microsoft Teams", "id": "fd7s65d350d6-cb68-11f0-ad52-1a3dbaec0535", "receiverWorkflowNamesToVersions": { "ms_teams_message_ticket": 1 }, "urlVerified": true, "sourcePlatform": "Microsoft Teams", "verifier": "HMAC_BASED", "headerKey": "Authorization", "secretValue": "***", "createdBy": "john.doe@acme.com", "webhookExecutionHistory": [ { "eventId": "fd7s71ff5869-cb69-11f0-8389-dacbc68a58cc", "matched": true, "workflowIds": [ "fd7s67b9a53e-cb69-11f0-8389-dacbc68a58cc" ], "payload": "{...}", "timeStamp": 1764231419304 } ] } ] ``` -------------------------------- ### Response Example Source: https://orkes.io/content/reference-docs/api/applications/get-all-applications This is an example of the JSON response you will receive when successfully retrieving all applications. It includes details like application ID, name, creator, timestamps, and tags. ```json [ { "id": "db66991f-206f-4695-8fe9-f5d53976c9a8", "name": "AGENTIC-INTERVIEW", "createdBy": "john.doe@acme.com", "updatedBy": "john.doe@acme.com", "createTime": 1768310094272, "updateTime": 1768310094272, "tags": [] }, { "id": "c536bc19-c42f-4e50-b723-63d22df8eb72", "name": "IDE-Integration", "createdBy": "john.doe@acme.com", "updatedBy": "john.doe@acme.com", "createTime": 1749454075757, "updateTime": 1749454075757, "tags": [] }, { "id": "bcd1886f-3e98-4f28-ba49-1174f6482f15", "name": "MCP", "createdBy": "john.doe@acme.com", "updatedBy": "john.doe@acme.com", "createTime": 1749017577618, "updateTime": 1749017577618, "tags": [] }, { "id": "orkes-api-gateway", "name": "Orkes API Gateway", "createdBy": "orkes-api-gateway@apps.orkes.io", "updatedBy": "orkes-api-gateway@apps.orkes.io", "createTime": 1770639711885, "updateTime": 1770639711885, "tags": [] }, { "id": "9ed69dec-c103-4eae-98bc-f1d4f4239eb7", "name": "Prompt Engineers", "createdBy": "john.doe@acme.com", "updatedBy": "john.doe@acme.com", "createTime": 1763452251120, "updateTime": 1763452251120, "tags": [ { "key": "test", "value": "prompt" } ] }, { "id": "79e87c16-ce40-48cf-a51e-a02e591c931a", "name": "agenticResearch", "createdBy": "john.doe@acme.com", "updatedBy": "john.doe@acme.com", "createTime": 1745628669221, "updateTime": 1745628669221, "tags": [] }, { "id": "43e9ecb9-268a-4048-8ae1-259cc45ef0e6", "name": "agenticTrader", "createdBy": "john.doe@acme.com", "updatedBy": "john.doe@acme.com", "createTime": 1742288943134, "updateTime": 1742288943134, "tags": [] }, { "id": "cf303235-7a24-404d-973a-17311841878b", "name": "java-worker-app", "createdBy": "john.doe@acme.com", "updatedBy": "john.doe@acme.com", "createTime": 1728528818710, "updateTime": 1728528818710, "tags": [] } ] ``` -------------------------------- ### Get Workflow with Task Execution Details Source: https://orkes.io/content/reference-docs/api/workflow/get-workflow-by-id This example demonstrates how to retrieve a workflow and its associated task execution details using a GET request. The `includeTasks=true` query parameter is used to fetch task information. ```APIDOC ## GET /api/workflow/{workflowId} ### Description Retrieves a workflow by its ID. If `includeTasks` is set to `true`, task execution details will be included in the response. ### Method GET ### Endpoint `/api/workflow/{workflowId}?includeTasks={boolean}` ### Parameters #### Query Parameters - **includeTasks** (boolean) - Optional - If true, includes task execution details in the response. ### Request Example ```curl curl -X 'GET' \ 'https:///api/workflow/3791f604-6d4c-11f0-880f-0246e7260963?includeTasks=true' \ -H 'accept: */*' \ -H 'X-Authorization: ' ``` ### Response #### Success Response (200) - **ownerApp** (string) - The application that owns the workflow. - **createTime** (long) - The creation timestamp of the workflow. - **updateTime** (long) - The last update timestamp of the workflow. - **createdBy** (string) - The user who created the workflow. - **updatedBy** (string) - The user who last updated the workflow. - **status** (string) - The current status of the workflow (e.g., COMPLETED, FAILED). - **endTime** (long) - The timestamp when the workflow completed or failed. - **workflowId** (string) - The unique identifier of the workflow. - **tasks** (array) - An array of task execution details. Each task object contains information such as `taskType`, `status`, `inputData`, `outputData`, and more. - **input** (object) - The input parameters provided to the workflow. - **output** (object) - The output of the workflow. - **taskToDomain** (object) - Mapping of tasks to their domains. - **failedReferenceTaskNames** (array) - A list of reference task names that failed. - **workflowDefinition** (object) - The definition of the workflow, including its tasks and configurations. #### Response Example ```json { "ownerApp": "", "createTime": 1753883456574, "updateTime": 1753883458402, "createdBy": "john.doe@acme.com", "updatedBy": "john.doe@acme.com", "status": "COMPLETED", "endTime": 1753883458400, "workflowId": "3791f604-6d4c-11f0-880f-0246e7260963", "tasks": [ { "taskType": "LLM_TEXT_COMPLETE", "status": "COMPLETED", "inputData": { "promptVariables": { "language": "", "text": "" }, "promptName": "translate", "llmProvider": "openAI", "temperature": 0, "model": "chatgpt-4o-latest", "_createdBy": "john.doe@acme.com", "prompt": "Translate the following text into .\n\n\n \n\n\nMake sure the translated output sounds native. Reply only with the translation and nothing else." }, "referenceTaskName": "llm_text_complete_task_ref", "retryCount": 0, "seq": 1, "pollCount": 1, "taskDefName": "LLM_TEXT_COMPLETE", "scheduledTime": 1753883456582, "startTime": 1753883456663, "endTime": 1753883458388, "updateTime": 1753883456663, "startDelayInSeconds": 0, "retried": false, "executed": true, "callbackFromWorker": true, "responseTimeoutSeconds": 3600, "workflowInstanceId": "3791f604-6d4c-11f0-880f-0246e7260963", "workflowType": "translation", "taskId": "37932e85-6d4c-11f0-880f-0246e7260963", "callbackAfterSeconds": 0, "workerId": "orkes-workers-deployment-7686d95698-l9rwl", "outputData": { "result": "It seems the text to be translated is missing. Please provide the text you'd like me to translate.", "finishReason": "stop", "tokenUsed": 57 }, "workflowTask": { "name": "llm_text_complete_task", "taskReferenceName": "llm_text_complete_task_ref", "inputParameters": { "llmProvider": "openAI", "model": "chatgpt-4o-latest", "promptName": "translate", "promptVariables": { "language": "", "text": "" }, "temperature": 0 }, "type": "LLM_TEXT_COMPLETE", "decisionCases": {}, "defaultCase": [], "forkTasks": [], "startDelay": 0, "joinOn": [], "optional": false, "defaultExclusiveJoinTask": [], "asyncComplete": false, "loopOver": [], "onStateChange": {}, "permissive": false }, "rateLimitPerFrequency": 0, "rateLimitFrequencyInSeconds": 1, "workflowPriority": 0, "iteration": 0, "subworkflowChanged": false, "firstStartTime": 0, "queueWaitTime": 81, "loopOverTask": false, "taskDefinition": null } ], "input": { "input": "What is your name?", "language": "Arabic" }, "output": { "result": "It seems the text to be translated is missing. Please provide the text you'd like me to translate.", "finishReason": "stop", "tokenUsed": 57 }, "taskToDomain": {}, "failedReferenceTaskNames": [], "workflowDefinition": { "createTime": 1751876511418, "updateTime": 1753883441350, "name": "translation", "description": "translation", "version": 1, "tasks": [ { "name": "llm_text_complete_task", "taskReferenceName": "llm_text_complete_task_ref", "inputParameters": { "llmProvider": "openAI", "model": "chatgpt-4o-latest", "promptName": "translate", "promptVariables": { "language": "", "text": "" }, "temperature": 0 }, "type": "LLM_TEXT_COMPLETE", "decisionCases": {}, "defaultCase": [], "forkTasks": [], "startDelay": 0, "joinOn": [], "optional": false, "defaultExclusiveJoinTask": [], "asyncComplete": false, "loopOver": [], "onStateChange": {}, "permissive": false } ], "inputParameters": [ "input", "language" ], "outputParameters": {}, "failureWorkflow": "", "schemaVersion": 2, "restartable": true, "workflowStatusListenerEnabled": false, "ownerEmail": "john.doe@acme.com", "timeoutPolicy": "ALERT_ONLY", "timeoutSeconds": 0, "variables": {}, "inputTemplate": {} } } ``` ``` -------------------------------- ### Expected Output Source: https://orkes.io/content/sdks/javascript The expected output after running the quickstart script, showing the workflow result and execution URL. ```text Result: Hello Conductor Execution: https://developer.orkescloud.com/execution/ ``` -------------------------------- ### Switch Task Input Parameters for Value-Param Example Source: https://orkes.io/content/reference-docs/operators/switch Provides the input parameters to run the Switch_Value_Param_Demo workflow. ```json { "status": "APPROVED" } ``` -------------------------------- ### Example Response for Get All Groups Source: https://orkes.io/content/reference-docs/api/groups/get-all-groups This is an example of the JSON response you will receive when successfully retrieving all groups. It includes details for each group such as their ID, description, assigned roles with permissions, default access, and contact information. ```json [ { "id": "Engineers", "description": "Engineering", "roles": [ { "name": "ADMIN", "permissions": [ { "name": "AUTHORIZATION_MANAGEMENT" }, { "name": "WORKFLOW_SEARCH" }, { "name": "PUBLISHER_MANAGEMENT" }, { "name": "API_GATEWAY_VIEW" }, { "name": "API_GATEWAY_MANAGEMENT" }, { "name": "WORKFLOW_MANAGEMENT" }, { "name": "PROMPT_MANAGEMENT" }, { "name": "EVENT_HANDLER_MANAGEMENT" }, { "name": "USER_MANAGEMENT" }, { "name": "PERMISSION_MANAGEMENT" }, { "name": "METADATA_VIEW" }, { "name": "ADMIN_MANAGEMENT" }, { "name": "METADATA_MANAGEMENT" }, { "name": "APPLICATION_MANAGEMENT" }, { "name": "BULK_MANAGEMENT" }, { "name": "SCHEDULE_MANAGEMENT" } ] } ], "defaultAccess": {}, "contactInformation": {} }, { "id": "TechWriters", "description": "A dedicated group for testing for tech writers", "roles": [ { "name": "METADATA_MANAGER", "permissions": [ { "name": "API_GATEWAY_VIEW" }, { "name": "API_GATEWAY_MANAGEMENT" }, { "name": "CREATE_INTEGRATION" }, { "name": "CREATE_SECRET" }, { "name": "METADATA_VIEW" }, { "name": "METADATA_MANAGEMENT" } ] } ], "defaultAccess": {}, "contactInformation": {} } ] ``` -------------------------------- ### Create, Register, and Start Workflow in C# Source: https://orkes.io/content/quickstarts/create-first-workflow Defines a workflow with HTTP, Switch, and Simple tasks, registers it, and starts its execution. Ensure you have the Conductor C# SDK installed and configured with your Orkes Conductor cluster details. ```csharp using Conductor.Client.Authentication; using Conductor.Client.Models; using Conductor.Client; using Conductor.Definition; using Conductor.Executor; using Conductor.Definition.TaskType; // Set up an application in your Orkes Conductor cluster. Sign up for a Developer Edition account at https://developer.orkescloud.com. // - Set your cluster's API URL as the BasePath (e.g., "https://developer.orkescloud.com/api" for Developer Edition). // - Use the application's Key ID and Secret here. var conf = new Configuration { BasePath = "_CHANGE_ME_", AuthenticationSettings = new OrkesAuthenticationSettings("_CHANGE_ME_", "_CHANGE_ME_") }; // A WorkflowExecutor instance is used to register and execute workflows. var executor = new WorkflowExecutor(conf); // Create the workflow definition. var workflow = new ConductorWorkflow() .WithName("myFirstWorkflow") .WithDescription("Workflow that greets a user. Uses a Switch task, HTTP task, and Simple task.") .WithVersion(1) .WithTask(new HttpTask("get-user_ref", new HttpTaskSettings { uri = "https://randomuser.me/api/" })) .WithTask(new SwitchTask("user-criteria_ref", "${get-user_ref.output.response.body.results[0].location.country}") .WithDecisionCase("United States", [new SimpleTask("helloWorld", "simple_ref").WithInput("user", "${get-user_ref.output.response.body.results[0].name.first}")])); // Register the workflow with overwrite = true. executor.RegisterWorkflow( workflow: workflow, overwrite: true ); // Start the workflow. var workflowId = executor.StartWorkflow(new StartWorkflowRequest(name: workflow.Name, version: workflow.Version)); Console.WriteLine($"Started Workflow: {workflowId}"); ``` -------------------------------- ### Expected Output Source: https://orkes.io/content/sdks/python The expected output after running the quickstart script, showing the workflow result and a link to the execution in the UI. ```text Result: Hello Conductor Execution: https://developer.orkescloud.com/execution/ ```