Workflow API

All Looply Workflow related API endpoints

triggerWorkflow

POSThttps://api.looply.io/v2/workflows/triggerworkflow/{workflow_id}/{workflow_version}

The triggerWorkflow endpoint initiates the execution of a specified workflow. When called, this endpoint triggers the workflow process, allowing you to automate various tasks and operations defined within the workflow. This endpoint can receive a JSON body payload to be passed to the workflow execution. A looply_execution_id will be returned on successful trigger of the workflow.

AWS IP address for whitelisting Looply API calls: 52.208.220.68

Path Parameters

Name
Type
Description

workflow_id*

string

id of the workflow

workflow_version

string

version of the workflow

Headers

Name
Type
Description

x-api-key*

string

Looply API Key

{
	"message": "success",
	"looply_execution_id": "****"
}

resumeWorkflow

POST https://api.looply.io/v2/workflows/resumeWorkflow/{process_id}

Manually resume workflows depending on the process_id supplied. Resuming a workflow can contain any JSON stringified body payload, source is the only protected attribute.

Path Parameters

Name
Type
Description

process_id*

string

process_id supplied to the triggerworkflow or the looply_execution_id if you did not supply one.

Headers

Name
Type
Description

x-api-key*

string

Looply API Key

Request Body

Name
Type
Description

payload*

object

Payload for workflow

payload.source*

string

Source of request - must be either SAP or TEAMS

Example Body

{
    "payload": {
        "source":"SAP", // or "TEAMS" -  Source is a protected attribute
        // Any other relevant data for your workflow here...
    }
}
{
    "message": "restarted" // or "already restarted"
}

terminateWorkflow

POST https://api.looply.io/v2/workflows/terminateWorkflow/{process_id}

Terminate an ongoing execution of your workflow - supports providing a termination reason.

Path Parameters

Name
Type
Description

process_id*

string

process_id supplied to the triggerworkflowor the looply_execution_id if you did not supply one.

Headers

Name
Type
Description

x-api-key*

string

Looply API Key

Request Body

Name
Type
Description

payload*

object

Payload for workflow

payload.termination_reason

string

Optional reason for termination - defaults to "Workflow execution terminated by user."

Example Body

{
    "payload": {
        "termination_reason": "Process has now expired."
    }
}

{
    "message": "terminated"
}

toggleScheduledWorkflow

POST https://api.looply.io/v2/workflows/toggleScheduledWorkflow

Pause and resume scheduled workflows.

Headers

Name
Type
Description

x-api-key

string

Looply API Key

Request Body

Name
Type
Description

workflow_id

String

id of the workflow

workflow_version

Number

version of the workflow

action

String

PAUSE or PLAY

Example Payload:

{
	"message": "success",
	"workflow_id": "be9439c2-16b9-4de2-bb1a-9154b85af065",
	"workflow_version": 1,
	"status": "ACTIVE" // or "PAUSED"
}

getWorkflowExecutionById

GET https://api.looply.io/v2/workflows/getWorkflowExecutionById

Returns the current state and logs for the workflow execution.

Query Parameters

Name
Type
Description

workflow_id*

String

Id of the workflow

workflow_execution_id*

String

Id for the workflow execution

Headers

Name
Type
Description

x-api-key*

String

Looply API Key

Example Payload:

{
	"message": "success",
	"item": {
		"workflow_current_state": "State Name",
		"organization_id": "****",
		"workflow_execution_id": "****",
		"modified_by": null,
		"workflow_version": 1,
		"workflow_event_log": {
			// trimmed down logs
		},
		"workflow_id": "****",
		"workflow_input_payload": {
			// combined input payload
		},
		"workflow_output_payload": {
			// combined output payload
		},
		"workflow_trigger_type": "REQUEST",
		"workspace_id": "****",
		"created_on": 1697641835712,
		"condensed_logs": {
            		// input/output for each step. Condensed
        	},
		"workflow_details": { 
			// structure of the workflow - connections and steps
		}
    }

getWorkflowExecutionHistory

GET https://api.looply.io/v2/workflows/getWorkflowExecutionHistory

Returns a list of workflow executions. Will return a lastKey attribute. Use this to get the next page of data.

Limit can be added to the request, 30 is the max.

Query Parameters

Name
Type
Description

workflow_id*

string

id of the workflow

limit

string

Number of items to return per page. Defaults to 20

workflow_execution_id

string

Pagination Key from the lastKey attribute.

Headers

Name
Type
Description

x-api-key*

string

Looply API Key

Example Payload:

{
	"message": "success",
	"count": 20,
	"items": [
		{
			"workflow_id": "****",
			"workflow_current_state": "wait_for_response_state",
			"modified_on": 1697454831391,
			"organization_id": "****",
			"workflow_execution_id": "****",
			"modified_by": null,
			"workflow_version": 1,
			"workflow_event_log": {
				// trimmed down logs
			},
			"workflow_trigger_type": "REQUEST",
			"workspace_id": "****",
			"created_on": 1697454828765,
			"workflow_details": {
				"workflow_name": "Workflow name"
			}
		}
		
	],
	"lastKey": {
		"workflow_id": "****",
		"workflow_execution_id": "****"
	}
}

getOrganizationExecutions

GET https://api.looply.io/v2/workflows/getOrganizationExecutions

Returns a list of all the workflow executions for an organization. Will return a lastKey attribute. Use this to get the next page of data.

Limit can be added to the request, 30 is the max.

Query Parameters

Name
Type
Description

limit

string

Number of items to return per page. Defaults to 20

workflow_id

string

Pagination Key from the lastKey attribute

workflow_execution_id

string

Pagination Key from the lastKey attribute

Example Payload:

{
	"message": "success",
	"count": 20,
	"items": [
		{
			"workflow_id": "****",
			"workflow_current_state": "wait_for_response_state",
			"modified_on": 1697454831391,
			"organization_id": "****",
			"workflow_execution_id": "****",
			"modified_by": null,
			"workflow_version": 1,
			"workflow_event_log": {
				// event log
			},
			"workflow_trigger_type": "REQUEST",
			"workspace_id": "****",
			"created_on": 1697454828765,
			"workflow_details": {
				"workflow_name": "Workflow name"
			}
		},
		
	],
	"lastKey": {
		"workflow_id": "****",
		"workflow_execution_id": "****"
	}
}

getWorkflowById

GET https://api.looply.io/v2/workflows/getWorkflowById

Returns all data for a Looply Workflow

Query Parameters

Name
Type
Description

workflow_id*

string

Id for the workflow

workflow_version*

string

Version of the workflow

Headers

Name
Type
Description

x-api-key*

string

Looply API Key

Example Payload:

{
  "message": "success",
  "item": {
    "organization_id": "****",
    "workflow_integrations": {
      // integrations configured for this workflow - e.g. SAP profile
    },
    "workflow_name": "****",
    "created_by": "test-user",
    "workflow_status_version": "DRAFT_1",
    "modified_by": null,
    "workflow_version": 1,
    "workflow_steps": [
      // states within the workflow
    ],
    "workflow_id": "****",
    "modified_on": 1697642922168,
    "workflow_connections": [
      // connections between all the workflow states
    ],
    "workflow_status": "DRAFT",
    "latest": "true",
    "workspace_id": "****",
    "created_on": 1695136500202,
    "workflow_schema": {
      // workflow schema
    }
  }
}

getOrganizationWorkflows

GET https://api.looply.io/v2/workflows/getOrganizationWorkflows

Returns a list organization workflows. Will return a lastKey attribute. Use this to get the next page of data.

Limit can be added to the request, 30 is the max.

Query Parameters

Name
Type
Description

limit

string

Number of items to return per page. Default 20

workflow_id

string

Pagination Key from the lastKey attribute.

workflow_version

string

Pagination Key from the lastKey attribute.

Headers

Name
Type
Description

x-api-key*

string

Looply API Key

Example Payload:

{
  "message": "success",
  "count": 20,
  "items": [
    {
      "workflow_id": "****",
      "modified_on": 1693488718083,
      "organization_id": "****",
      "workflow_status": "ACTIVE",
      "latest": "false",
      "workflow_name": "Adaptive Card Workflow",
      "created_by": "****",
      "workflow_status_version": "ACTIVE_3",
      "modified_by": "****",
      "workspace_id": "****",
      "created_on": 1692614072550
    }
  ],
  "lastKey": {
    "organization_id": "****",
    "workflow_id": "****",
    "workflow_version": 1
  }
}

getWorkflowSchemaById

GET https://api.looply.io/v2/workflows/getWorkflowSchemaById

Returns the data schema for a workflow

Query Parameters

Name
Type
Description

workflow_id*

string

Id of the workflow

workflow_version*

string

Version of the workflow

Headers

Name
Type
Description

x-api-key*

string

Looply API Key

Example Payload:

{
  "message": "success",
  "item": {
    "workflow_id": "****",
    "modified_on": 1697642922168,
    "created_by": "test-user",
    "workflow_mock_payload": {
      // mock payload from a previous execution
    },
    "workflow_schema": {
      // schema for the mock payload
    },
    "modified_by": null,
    "workflow_version": 1,
    "created_on": 1695136500202
  }
}

Last updated