Workflows
The full list of request body parameters and possible outcomes can be found here.
#
Get all workflowsGetWorkflowsResponse response = fourApi.workflowsClient().getWorkflows().get();
#
Get a workflowGetWorkflowsResponse response = fourApi.workflowsClient().getWorkflow("workflowId").get();
#
Add a workflowCreateWorkflowRequest request = CreateWorkflowRequest.builder() .name() .actions() .conditions() .build();
CreateWorkflowResponse response = fourApi.workflowsClient().createWorkflow(request).get();
#
Remove a workflowRemoves a workflow so it is no longer being executed. Actions of already executed workflows will be still processed.
fourApi.workflowsClient().removeWorkflow(workflowId).get();
#
Patch a workflowUpdate the name of a workflow.
UpdateWorkflowRequest request = UpdateWorkflowRequest.builder() .name() .build();
UpdateWorkflowResponse response = fourApi.workflowsClient().updateWorkflow(workflowId, request).get();
#
Update a workflow actionWebhookWorkflowActionRequest request = WebhookWorkflowActionRequest.builder() .signature() .headers() .url() .build();
fourApi.workflowsClient().updateWorkflowAction(workflowId, actionId, request).get();
#
Update a workflow conditionEventWorkflowConditionRequest request = EventWorkflowConditionRequest.builder() .events() .build();
fourApi.workflowsClient().updateWorkflowCondition(workflowResponseId, eventConditionId, request).get();
#
Get event typesList<EventTypesResponse> response = fourApi.workflowsClient().getEventTypes().get();
#
Get an eventGetEventResponse response = fourApi.workflowsClient().getEvent(eventId).get();
#
Get subject eventsGet all events that relate to a specific subject
SubjectEventsResponse response = fourApi.workflowsClient().getSubjectEvents(payment.getId()).get();
#
Reflow by eventReflows a past event denoted by the event ID and triggers the actions of any workflows with matching conditions.
ReflowResponse response = fourApi.workflowsClient().reflowByEvent(eventId).get();
#
Reflow by event and workflowReflows a past event by event ID and workflow ID. Triggers all the actions of a specific event and workflow combination if the event denoted by the event ID matches the workflow conditions.
ReflowResponse response = fourApi.workflowsClient().reflowByEventAndWorkflow(eventId, workflowId).get();
#
ReflowReflow past events attached to multiple event IDs and workflow IDs, or to multiple subject IDs and workflow IDs. If you don't specify any workflow IDs, all matching workflows will be retriggered.
ReflowByEventsRequest request = ReflowByEventsRequest.builder() .events() .workflows() .build();
ReflowResponse response = fourApi.workflowsClient().reflow(request).get();
#
Reflow by subjectReflows the events associated with a subject ID (for example, a payment ID or a dispute ID) and triggers the actions of any workflows with matching conditions.
ReflowByEventsRequest request = ReflowByEventsRequest.builder() .events() .workflows() .build();
ReflowResponse response = fourApi.workflowsClient().reflowBySubject("subject").get();
#
Reflow by subject and workflowReflows the events associated with a subject ID (for example, a payment ID or a dispute ID) and triggers the actions of the specified workflow if the conditions match.
ReflowByEventsRequest request = ReflowByEventsRequest.builder() .events() .workflows() .build();
ReflowResponse response = fourApi.workflowsClient().reflowBySubjectAndWorkflow("subject", workflowId).get();