Skip to main content
Browse Documentation

Invoking workflow for a component

Created by Alex Pop on 19 Dec 2019

Workflow events can be invoked for a specific content type.

invokeWorkflow(component: Component, event: string, data?: any): Promise<Component>

Parameters

Name Type Format Description
contentType object Component The component object.
event string The event type, currently the only one supported for components is publish.
data? object The optional event data.

Returns

A Promise that will resolve with a Component object.

Example

client.components.invokeWorkflow(existingComponent, 'publish')
  .then(result => {      
    console.log('API call result: ', result);              
  })
  .catch(error => {
    console.log('API call fetch error: ', error);      
});