(orchestration().v2())
Cancel a running workflow
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2CancelEventRequest;
import com.formance.formance_sdk.models.operations.V2CancelEventResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2CancelEventRequest req = V2CancelEventRequest.builder()
.instanceID("xxx")
.build();
V2CancelEventResponse res = sdk.orchestration().v2().cancelEvent()
.request(req)
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
request |
V2CancelEventRequest |
✔️ |
The request object to use for the request. |
V2CancelEventResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Create trigger
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2CreateTriggerResponse;
import com.formance.formance_sdk.models.shared.Security;
import com.formance.formance_sdk.models.shared.V2TriggerData;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2TriggerData req = V2TriggerData.builder()
.event("<value>")
.workflowID("<id>")
.build();
V2CreateTriggerResponse res = sdk.orchestration().v2().createTrigger()
.request(req)
.call();
if (res.v2CreateTriggerResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
V2TriggerData |
✔️ |
The request object to use for the request. |
V2CreateTriggerResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Create a workflow
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2CreateWorkflowResponse;
import com.formance.formance_sdk.models.shared.Security;
import com.formance.formance_sdk.models.shared.V2CreateWorkflowRequest;
import java.lang.Exception;
import java.util.List;
import java.util.Map;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2CreateWorkflowRequest req = V2CreateWorkflowRequest.builder()
.stages(List.of(
Map.ofEntries(
Map.entry("key", "<value>"))))
.build();
V2CreateWorkflowResponse res = sdk.orchestration().v2().createWorkflow()
.request(req)
.call();
if (res.v2CreateWorkflowResponse().isPresent()) {
// handle response
}
}
}
V2CreateWorkflowResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Read trigger
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2DeleteTriggerRequest;
import com.formance.formance_sdk.models.operations.V2DeleteTriggerResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2DeleteTriggerRequest req = V2DeleteTriggerRequest.builder()
.triggerID("<id>")
.build();
V2DeleteTriggerResponse res = sdk.orchestration().v2().deleteTrigger()
.request(req)
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
request |
V2DeleteTriggerRequest |
✔️ |
The request object to use for the request. |
V2DeleteTriggerResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Delete a flow by id
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2DeleteWorkflowRequest;
import com.formance.formance_sdk.models.operations.V2DeleteWorkflowResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2DeleteWorkflowRequest req = V2DeleteWorkflowRequest.builder()
.flowId("xxx")
.build();
V2DeleteWorkflowResponse res = sdk.orchestration().v2().deleteWorkflow()
.request(req)
.call();
// handle response
}
}
V2DeleteWorkflowResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get a workflow instance by id
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2GetInstanceRequest;
import com.formance.formance_sdk.models.operations.V2GetInstanceResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2GetInstanceRequest req = V2GetInstanceRequest.builder()
.instanceID("xxx")
.build();
V2GetInstanceResponse res = sdk.orchestration().v2().getInstance()
.request(req)
.call();
if (res.v2GetWorkflowInstanceResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
V2GetInstanceRequest |
✔️ |
The request object to use for the request. |
V2GetInstanceResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get a workflow instance history by id
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2GetInstanceHistoryRequest;
import com.formance.formance_sdk.models.operations.V2GetInstanceHistoryResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2GetInstanceHistoryRequest req = V2GetInstanceHistoryRequest.builder()
.instanceID("xxx")
.build();
V2GetInstanceHistoryResponse res = sdk.orchestration().v2().getInstanceHistory()
.request(req)
.call();
if (res.v2GetWorkflowInstanceHistoryResponse().isPresent()) {
// handle response
}
}
}
V2GetInstanceHistoryResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get a workflow instance stage history
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2GetInstanceStageHistoryRequest;
import com.formance.formance_sdk.models.operations.V2GetInstanceStageHistoryResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2GetInstanceStageHistoryRequest req = V2GetInstanceStageHistoryRequest.builder()
.instanceID("xxx")
.number(0L)
.build();
V2GetInstanceStageHistoryResponse res = sdk.orchestration().v2().getInstanceStageHistory()
.request(req)
.call();
if (res.v2GetWorkflowInstanceHistoryStageResponse().isPresent()) {
// handle response
}
}
}
V2GetInstanceStageHistoryResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get server info
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2GetServerInfoResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2GetServerInfoResponse res = sdk.orchestration().v2().getServerInfo()
.call();
if (res.v2ServerInfo().isPresent()) {
// handle response
}
}
}
V2GetServerInfoResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get a flow by id
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2GetWorkflowRequest;
import com.formance.formance_sdk.models.operations.V2GetWorkflowResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2GetWorkflowRequest req = V2GetWorkflowRequest.builder()
.flowId("xxx")
.build();
V2GetWorkflowResponse res = sdk.orchestration().v2().getWorkflow()
.request(req)
.call();
if (res.v2GetWorkflowResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
V2GetWorkflowRequest |
✔️ |
The request object to use for the request. |
V2GetWorkflowResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
List instances of a workflow
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2ListInstancesRequest;
import com.formance.formance_sdk.models.operations.V2ListInstancesResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2ListInstancesRequest req = V2ListInstancesRequest.builder()
.cursor("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==")
.pageSize(100L)
.running(true)
.workflowID("xxx")
.build();
V2ListInstancesResponse res = sdk.orchestration().v2().listInstances()
.request(req)
.call();
if (res.v2ListRunsResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
V2ListInstancesRequest |
✔️ |
The request object to use for the request. |
V2ListInstancesResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
List triggers
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2ListTriggersRequest;
import com.formance.formance_sdk.models.operations.V2ListTriggersResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2ListTriggersRequest req = V2ListTriggersRequest.builder()
.cursor("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==")
.pageSize(100L)
.build();
V2ListTriggersResponse res = sdk.orchestration().v2().listTriggers()
.request(req)
.call();
if (res.v2ListTriggersResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
V2ListTriggersRequest |
✔️ |
The request object to use for the request. |
V2ListTriggersResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
List triggers occurrences
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2ListTriggersOccurrencesRequest;
import com.formance.formance_sdk.models.operations.V2ListTriggersOccurrencesResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2ListTriggersOccurrencesRequest req = V2ListTriggersOccurrencesRequest.builder()
.triggerID("<id>")
.cursor("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==")
.pageSize(100L)
.build();
V2ListTriggersOccurrencesResponse res = sdk.orchestration().v2().listTriggersOccurrences()
.request(req)
.call();
if (res.v2ListTriggersOccurrencesResponse().isPresent()) {
// handle response
}
}
}
V2ListTriggersOccurrencesResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
List registered workflows
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2ListWorkflowsRequest;
import com.formance.formance_sdk.models.operations.V2ListWorkflowsResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2ListWorkflowsRequest req = V2ListWorkflowsRequest.builder()
.cursor("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==")
.pageSize(100L)
.build();
V2ListWorkflowsResponse res = sdk.orchestration().v2().listWorkflows()
.request(req)
.call();
if (res.v2ListWorkflowsResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
V2ListWorkflowsRequest |
✔️ |
The request object to use for the request. |
V2ListWorkflowsResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Read trigger
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2ReadTriggerRequest;
import com.formance.formance_sdk.models.operations.V2ReadTriggerResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2ReadTriggerRequest req = V2ReadTriggerRequest.builder()
.triggerID("<id>")
.build();
V2ReadTriggerResponse res = sdk.orchestration().v2().readTrigger()
.request(req)
.call();
if (res.v2ReadTriggerResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
V2ReadTriggerRequest |
✔️ |
The request object to use for the request. |
V2ReadTriggerResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Run workflow
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2RunWorkflowRequest;
import com.formance.formance_sdk.models.operations.V2RunWorkflowResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2RunWorkflowRequest req = V2RunWorkflowRequest.builder()
.workflowID("xxx")
.build();
V2RunWorkflowResponse res = sdk.orchestration().v2().runWorkflow()
.request(req)
.call();
if (res.v2RunWorkflowResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
V2RunWorkflowRequest |
✔️ |
The request object to use for the request. |
V2RunWorkflowResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Send an event to a running workflow
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.V2SendEventRequest;
import com.formance.formance_sdk.models.operations.V2SendEventResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
V2SendEventRequest req = V2SendEventRequest.builder()
.instanceID("xxx")
.build();
V2SendEventResponse res = sdk.orchestration().v2().sendEvent()
.request(req)
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
request |
V2SendEventRequest |
✔️ |
The request object to use for the request. |
V2SendEventResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Test trigger
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.V2Error;
import com.formance.formance_sdk.models.operations.TestTriggerRequest;
import com.formance.formance_sdk.models.operations.TestTriggerResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws V2Error, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
TestTriggerRequest req = TestTriggerRequest.builder()
.triggerID("<id>")
.build();
TestTriggerResponse res = sdk.orchestration().v2().testTrigger()
.request(req)
.call();
if (res.v2TestTriggerResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
TestTriggerRequest |
✔️ |
The request object to use for the request. |
TestTriggerResponse
Error Type |
Status Code |
Content Type |
models/errors/V2Error |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |