(Orchestration)
- 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
- TestTrigger - Test trigger
- V2CancelEvent - Cancel a running workflow
- V2CreateTrigger - Create trigger
- V2CreateWorkflow - Create workflow
- V2DeleteTrigger - Delete trigger
- V2DeleteWorkflow - Delete a flow by id
- V2GetInstance - Get a workflow instance by id
- V2GetInstanceHistory - Get a workflow instance history by id
- V2GetInstanceStageHistory - Get a workflow instance stage history
- V2GetServerInfo - Get server info
- V2GetWorkflow - Get a flow by id
- V2ListInstances - List instances of a workflow
- V2ListTriggers - List triggers
- V2ListTriggersOccurrences - List triggers occurrences
- V2ListWorkflows - List registered workflows
- V2ReadTrigger - Read trigger
- V2RunWorkflow - Run workflow
- V2SendEvent - Send an event to a running workflow
Cancel a running workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.CancelEvent(ctx, operations.CancelEventRequest{
InstanceID: "<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.CancelEventRequest | ✔️ | The request object to use for the request. |
*operations.CancelEventResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Create trigger
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.CreateTrigger(ctx, &shared.TriggerData{
Event: "<value>",
WorkflowID: "<value>",
})
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. |
*operations.CreateTriggerResponse, error
Error Object | 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/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.CreateWorkflow(ctx, &shared.CreateWorkflowRequest{
Stages: []map[string]interface{}{
map[string]interface{}{
"key": "<value>",
},
},
})
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. |
*operations.CreateWorkflowResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Read trigger
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.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. |
*operations.DeleteTriggerResponse, error
Error Object | 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/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.DeleteWorkflow(ctx, operations.DeleteWorkflowRequest{
FlowID: "<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.DeleteWorkflowRequest | ✔️ | The request object to use for the request. |
*operations.DeleteWorkflowResponse, error
Error Object | 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/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.GetInstance(ctx, operations.GetInstanceRequest{
InstanceID: "<value>",
})
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. |
*operations.GetInstanceResponse, error
Error Object | 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/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.GetInstanceHistory(ctx, operations.GetInstanceHistoryRequest{
InstanceID: "<value>",
})
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. |
*operations.GetInstanceHistoryResponse, error
Error Object | 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/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.GetInstanceStageHistory(ctx, operations.GetInstanceStageHistoryRequest{
InstanceID: "<value>",
Number: 600636,
})
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. |
*operations.GetInstanceStageHistoryResponse, error
Error Object | 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/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.GetWorkflow(ctx, operations.GetWorkflowRequest{
FlowID: "<value>",
})
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. |
*operations.GetWorkflowResponse, error
Error Object | 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/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.ListInstances(ctx, operations.ListInstancesRequest{})
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. |
*operations.ListInstancesResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
List triggers
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.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. |
*operations.ListTriggersResponse, error
Error Object | 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/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.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. |
*operations.ListTriggersOccurrencesResponse, error
Error Object | 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/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.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. |
*operations.ListWorkflowsResponse, error
Error Object | 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/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.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. |
*operations.OrchestrationgetServerInfoResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Read trigger
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.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. |
*operations.ReadTriggerResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Run workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.RunWorkflow(ctx, operations.RunWorkflowRequest{
WorkflowID: "<value>",
})
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. |
*operations.RunWorkflowResponse, error
Error Object | 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/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.SendEvent(ctx, operations.SendEventRequest{
InstanceID: "<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.SendEventRequest | ✔️ | The request object to use for the request. |
*operations.SendEventResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Test trigger
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.TestTrigger(ctx, operations.TestTriggerRequest{
TriggerID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.V2TestTriggerResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.TestTriggerRequest | ✔️ | The request object to use for the request. |
*operations.TestTriggerResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Cancel a running workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2CancelEvent(ctx, operations.V2CancelEventRequest{
InstanceID: "<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.V2CancelEventRequest | ✔️ | The request object to use for the request. |
*operations.V2CancelEventResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Create trigger
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2CreateTrigger(ctx, &shared.V2TriggerData{
Event: "<value>",
WorkflowID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.V2CreateTriggerResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
shared.V2TriggerData | ✔️ | The request object to use for the request. |
*operations.V2CreateTriggerResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Create a workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2CreateWorkflow(ctx, &shared.V2CreateWorkflowRequest{
Stages: []map[string]interface{}{
map[string]interface{}{
"key": "<value>",
},
},
})
if err != nil {
log.Fatal(err)
}
if res.V2CreateWorkflowResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
shared.V2CreateWorkflowRequest | ✔️ | The request object to use for the request. |
*operations.V2CreateWorkflowResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Read trigger
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2DeleteTrigger(ctx, operations.V2DeleteTriggerRequest{
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.V2DeleteTriggerRequest | ✔️ | The request object to use for the request. |
*operations.V2DeleteTriggerResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Delete a flow by id
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2DeleteWorkflow(ctx, operations.V2DeleteWorkflowRequest{
FlowID: "<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.V2DeleteWorkflowRequest | ✔️ | The request object to use for the request. |
*operations.V2DeleteWorkflowResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Get a workflow instance by id
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2GetInstance(ctx, operations.V2GetInstanceRequest{
InstanceID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.V2GetWorkflowInstanceResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.V2GetInstanceRequest | ✔️ | The request object to use for the request. |
*operations.V2GetInstanceResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Get a workflow instance history by id
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2GetInstanceHistory(ctx, operations.V2GetInstanceHistoryRequest{
InstanceID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.V2GetWorkflowInstanceHistoryResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.V2GetInstanceHistoryRequest | ✔️ | The request object to use for the request. |
*operations.V2GetInstanceHistoryResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Get a workflow instance stage history
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2GetInstanceStageHistory(ctx, operations.V2GetInstanceStageHistoryRequest{
InstanceID: "<value>",
Number: 465454,
})
if err != nil {
log.Fatal(err)
}
if res.V2GetWorkflowInstanceHistoryStageResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.V2GetInstanceStageHistoryRequest | ✔️ | The request object to use for the request. |
*operations.V2GetInstanceStageHistoryResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Get server info
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2GetServerInfo(ctx)
if err != nil {
log.Fatal(err)
}
if res.V2ServerInfo != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
*operations.V2GetServerInfoResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Get a flow by id
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2GetWorkflow(ctx, operations.V2GetWorkflowRequest{
FlowID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.V2GetWorkflowResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.V2GetWorkflowRequest | ✔️ | The request object to use for the request. |
*operations.V2GetWorkflowResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
List instances of a workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2ListInstances(ctx, operations.V2ListInstancesRequest{
Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="),
})
if err != nil {
log.Fatal(err)
}
if res.V2ListRunsResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.V2ListInstancesRequest | ✔️ | The request object to use for the request. |
*operations.V2ListInstancesResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
List triggers
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2ListTriggers(ctx, operations.V2ListTriggersRequest{
Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="),
})
if err != nil {
log.Fatal(err)
}
if res.V2ListTriggersResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.V2ListTriggersRequest | ✔️ | The request object to use for the request. |
*operations.V2ListTriggersResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
List triggers occurrences
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2ListTriggersOccurrences(ctx, operations.V2ListTriggersOccurrencesRequest{
Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="),
TriggerID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.V2ListTriggersOccurrencesResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.V2ListTriggersOccurrencesRequest | ✔️ | The request object to use for the request. |
*operations.V2ListTriggersOccurrencesResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
List registered workflows
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2ListWorkflows(ctx, operations.V2ListWorkflowsRequest{
Cursor: formancesdkgo.String("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="),
})
if err != nil {
log.Fatal(err)
}
if res.V2ListWorkflowsResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.V2ListWorkflowsRequest | ✔️ | The request object to use for the request. |
*operations.V2ListWorkflowsResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Read trigger
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2ReadTrigger(ctx, operations.V2ReadTriggerRequest{
TriggerID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.V2ReadTriggerResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.V2ReadTriggerRequest | ✔️ | The request object to use for the request. |
*operations.V2ReadTriggerResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Run workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2RunWorkflow(ctx, operations.V2RunWorkflowRequest{
WorkflowID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.V2RunWorkflowResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.V2RunWorkflowRequest | ✔️ | The request object to use for the request. |
*operations.V2RunWorkflowResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Send an event to a running workflow
package main
import(
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
formancesdkgo "github.com/formancehq/formance-sdk-go/v2"
"context"
"github.com/formancehq/formance-sdk-go/v2/pkg/models/operations"
"log"
)
func main() {
s := formancesdkgo.New(
formancesdkgo.WithSecurity(shared.Security{
Authorization: "<YOUR_AUTHORIZATION_HERE>",
}),
)
ctx := context.Background()
res, err := s.Orchestration.V2SendEvent(ctx, operations.V2SendEventRequest{
InstanceID: "<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.V2SendEventRequest | ✔️ | The request object to use for the request. |
*operations.V2SendEventResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.V2Error | default | application/json |
sdkerrors.SDKError | 4xx-5xx | / |