Executing workflows
Linked API is built around the concept of workflows. This means that any automation you want to perform (such as sending a connection request, commenting on a post, retrieving company data, etc.) must be executed as a workflow.
Executing a workflow consists of 2 key steps:
- Starting a workflow and receiving its
workflowId
. - Periodically checking for the result using the
workflowId
.
Starting workflows
To start executing a workflow, make a POST
request to the following endpoint:
POST https://api.linkedapi.io/workflows
In the request body, include a JSON that describes your workflow, for example:
{
"actionType": "st.checkConnectionStatus",
"personUrl": "https://www.linkedin.com/in/person1"
}
Upon successful request, you will receive the following response:
{
"success": true,
"result": {
"workflowId": "wf-64835e7c-a0gc-40ae-8338-108f02sSe643"
}
}
workflowId
– unique workflow identifier for checking the result.
In case of an unsuccessful request, you will receive the following response:
{
"success": false,
"error": {
"type": "linkedApiTokenRequired",
"message": "'linked-api-token' is missing in request headers."
}
}
error
– either a common error or one of the following specific errors:invalidWorkflow
– workflow configuration is not valid due to violated action constraints or invalid action parameters:{validation_details}
.
plusPlanRequired
– some actions in this workflow require the Plus plan.linkedinAccountSignedOut
– your LinkedIn account has been signed out in our cloud browser. This occasionally happens as LinkedIn may sign out accounts after an extended period. You'll need to visit our platform and reconnect your account.
Checking for result
After starting your workflow and receiving the workflowId
, you need to periodically check the workflow result. To do this, send a GET
request to the following endpoint:
GET https://api.linkedapi.io/workflows/{workflowId}
Depending on the workflow execution status, you'll receive one of these results:
- Workflow is still running:
{
"success": true,
"result": {
"workflowStatus": "running"
}
}
- Workflow completed successfully:
{
"success": true,
"result": {
"workflowStatus": "completed",
"completion": {
"actionType": "st.checkConnectionStatus",
"success": true,
"data": {
"connectionStatus": "pending"
}
}
}
}
completion
– results of all actions included in this workflow.
- Workflow failed:
{
"success": true,
"result": {
"workflowStatus": "failed",
"failure": {
"reason": "linkedinAccountSignedOut",
"message": "This LinkedIn account has been signed out in our cloud browser."
}
}
}
failure
– object describing the workflow failure reason:linkedinAccountSignedOut
– your LinkedIn account has been signed out in our cloud browser. This occasionally happens as LinkedIn may sign out accounts after an extended period. You'll need to visit our platform and reconnect your account.languageNotSupported
– your LinkedIn account uses a language other than English, which is currently the only supported option. If you encounter this issue, please contact our support. We prioritize adding new languages based on user requests, so your feedback is important.
Cancelling workflows
Some workflows in Linked API can take a long time to complete. If you decide you no longer need a workflow to finish, you have the option to cancel it.
You can cancel a running workflow directly on our platform. Simply click the three dots menu next to the running workflow and select "Cancel".
Alternatively, you can cancel a workflow via API. To do this, you need to make a DELETE
request to the following endpoint:
DELETE https://api.linkedapi.io/workflows/{workflowId}
Upon successful cancellation, you will receive the following response:
{
"success": true,
"result": {
"cancelled": true
}
}
Important notes:
- Partial execution. The workflow is cancelled at its current execution point. Any actions that have already been completed cannot be undone. For example, if the workflow has already sent messages or connection requests from your LinkedIn account, these actions will remain executed.
- No intermediate data. Once a workflow is cancelled, no data is preserved or returned. You will not receive any intermediate results or partial data that may have been collected before cancellation.