customWorkflow
This method allows you to execute a custom Linked API workflow using a raw workflow definition for complex multi-step operations.
try {
const workflowId = await linkedapi.customWorkflow.execute({
actionType: "st.searchCompanies",
term: "AI startup",
filter: {
locations: ["San Francisco", "New York"],
sizes: ["11-50", "51-200"]
},
limit: 10,
then: {
actionType: "st.doForCompanies",
then: {
actionType: "st.openCompanyPage",
basicInfo: true,
then: {
actionType: "st.retrieveCompanyEmployees",
limit: 5,
filter: {
position: "manager"
},
then: {
actionType: "st.doForPeople",
then: {
actionType: "st.sendConnectionRequest",
note: "Hi! I'd love to connect and discuss opportunities."
}
}
}
}
}
});
const { data } = await linkedapi.customWorkflow.result(workflowId);
console.log('Custom workflow executed successfully.');
console.log('Workflow result:', data);
} catch (e) {
// A list of all critical errors can be found here:
// https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
if (e instanceof LinkedApiError) {
console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
} else {
console.error('An unexpected, non-API error occurred:', e);
}
}
# Python SDK is coming soon!
#
# You can always use Linked API through HTTP
# https://linkedapi.io/docs/
// Go SDK is coming soon!
//
// You can always use Linked API through HTTP
// https://linkedapi.io/docs/
Params
Pass a workflow definition object that follows our HTTP API workflow format.
Data
Completion object that matches our HTTP API completion format.
Errors
The method has no execution errors (errors
is always []
).