(Orchestration.V1)
- CancelEvent - Cancel a running workflow
- CreateTrigger - Create trigger
- CreateWorkflow - Create workflow
- DeleteTrigger - Delete trigger
- DeleteWorkflow - Delete a flow by id
- GetInstance - Get a workflow instance by id
- GetInstanceHistory - Get a workflow instance history by id
- GetInstanceStageHistory - Get a workflow instance stage history
- GetWorkflow - Get a flow by id
- ListInstances - List instances of a workflow
- ListTriggers - List triggers
- ListTriggersOccurrences - List triggers occurrences
- ListWorkflows - List registered workflows
- OrchestrationgetServerInfo - Get server info
- ReadTrigger - Read trigger
- RunWorkflow - Run workflow
- SendEvent - Send an event to a running workflow
Cancel a running workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.CancelEvent(ctx, operations.CancelEventRequest{
InstanceID: "xxx",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.CancelEventRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.CancelEventResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Create trigger
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.CreateTrigger(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.CreateTriggerResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
shared.TriggerData | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.CreateTriggerResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Create a workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.CreateWorkflow(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.CreateWorkflowResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
shared.CreateWorkflowRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.CreateWorkflowResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Read trigger
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.DeleteTrigger(ctx, operations.DeleteTriggerRequest{
TriggerID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.DeleteTriggerRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.DeleteTriggerResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Delete a flow by id
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.DeleteWorkflow(ctx, operations.DeleteWorkflowRequest{
FlowID: "xxx",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.DeleteWorkflowRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.DeleteWorkflowResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Get a workflow instance by id
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.GetInstance(ctx, operations.GetInstanceRequest{
InstanceID: "xxx",
})
if err != nil {
log.Fatal(err)
}
if res.GetWorkflowInstanceResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetInstanceRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetInstanceResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Get a workflow instance history by id
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.GetInstanceHistory(ctx, operations.GetInstanceHistoryRequest{
InstanceID: "xxx",
})
if err != nil {
log.Fatal(err)
}
if res.GetWorkflowInstanceHistoryResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetInstanceHistoryRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetInstanceHistoryResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Get a workflow instance stage history
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.GetInstanceStageHistory(ctx, operations.GetInstanceStageHistoryRequest{
InstanceID: "xxx",
Number: 0,
})
if err != nil {
log.Fatal(err)
}
if res.GetWorkflowInstanceHistoryStageResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetInstanceStageHistoryRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetInstanceStageHistoryResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Get a flow by id
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.GetWorkflow(ctx, operations.GetWorkflowRequest{
FlowID: "xxx",
})
if err != nil {
log.Fatal(err)
}
if res.GetWorkflowResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetWorkflowRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetWorkflowResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
List instances of a workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.ListInstances(ctx, operations.ListInstancesRequest{
Running: formancesdkgo.Bool(true),
WorkflowID: formancesdkgo.String("xxx"),
})
if err != nil {
log.Fatal(err)
}
if res.ListRunsResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListInstancesRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListInstancesResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
List triggers
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.ListTriggers(ctx, operations.ListTriggersRequest{})
if err != nil {
log.Fatal(err)
}
if res.ListTriggersResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListTriggersRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListTriggersResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
List triggers occurrences
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.ListTriggersOccurrences(ctx, operations.ListTriggersOccurrencesRequest{
TriggerID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.ListTriggersOccurrencesResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListTriggersOccurrencesRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListTriggersOccurrencesResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
List registered workflows
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.ListWorkflows(ctx)
if err != nil {
log.Fatal(err)
}
if res.ListWorkflowsResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListWorkflowsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Get server info
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.OrchestrationgetServerInfo(ctx)
if err != nil {
log.Fatal(err)
}
if res.ServerInfo != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.OrchestrationgetServerInfoResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Read trigger
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.ReadTrigger(ctx, operations.ReadTriggerRequest{
TriggerID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.ReadTriggerResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ReadTriggerRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ReadTriggerResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Run workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.RunWorkflow(ctx, operations.RunWorkflowRequest{
WorkflowID: "xxx",
})
if err != nil {
log.Fatal(err)
}
if res.RunWorkflowResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.RunWorkflowRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RunWorkflowResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Send an event to a running workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
"context"
"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
ClientID: formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Orchestration.V1.SendEvent(ctx, operations.SendEventRequest{
InstanceID: "xxx",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.SendEventRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SendEventResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |