Go QuickStart Example
This repository contains sample applications that demonstrates the various features of Conductor Go SDK.
SDK Features
Go SDK for Conductor allows you to:
- Create workflow using Code
- Execute workflows
- Create workers for task execution and framework (TaskRunner) for executing workers and communicating with the server.
- Support for all the APIs such as
- Managing tasks (poll, update etc.),
- Managing workflows (start, pause, resume, terminate, get status, search etc.)
- Create and update workflow and task metadata
- User and event management
Running Example
Note
Obtain KEY and SECRET from the playground or your Conductor server. Quick tutorial for playground
Export variables
export KEY=
export SECRET=
export CONDUCTOR_SERVER_URL=https://play.orkes.io/api
Run the main program
go run main.go
Workflow
We create a simple 2-step workflow that fetches the user details and sends an email.

Visual | Code |
func CreateWorkflow() *workflow.ConductorWorkflow {
return workflow.NewConductorWorkflow(workflowExecutor).
Name("user_notification").
Version(1).
InputParameters("userId", "notificationPref").
Add(workflow.NewSimpleTask("get_user_info", "get_user_info").Input("userId", "${workflow.input.userId}")).
Add(workflow.NewSwitchTask("emailorsms", "${workflow.input.notificationPref}"))
}
|
Worker
Workers are a simple interface implementation. See workers.go for more details.
Executing Workflows
There are two ways to execute a workflow:
- Synchronously - useful for short duration workflows that completes within a few second.
- Asynchronously - workflows that runs for longer period
Synchronous Workflow Execution
ConductorWorkflow#ExecuteWorkflow(...)
Asynchronous Workflow Execution
ConductorWorkflow#StartWorkflow(...)
See main.go for complete code sample of workflow execution.