Docs > Workflow
Workflow has two main uses: authorization and automation.
Every object in PostCMS has a workflow attached to it, usually inherited from the content type or web page template. The workflow specifies the allowed states for an object, and the available transitions between them.
Examples:
• When a photo is imported into PostCMS, a trigger could be used to automatically crop and resize it, and create thumbnail images
• When a new blog post is published, a trigger could check whether an archive page already existed for the month the post is in, and if not create one.
• When the home page is updated, a trigger could send an email to the site administrator to ask that they approve the page for publication.
These are just some of the possibilties. Careful use of workflow triggers can considerably reduce repetitive work for your site's content authors.
Authorisation
You can limit authorisation for a given transition to specified user roles or groups. For example, you might specify that only a user with the "Editor" role can publish pages with the "Requires approval" workflow.Automation
You can also attach a block of code to a transition, called a "trigger". A trigger has full access to the API, and can be used to carry out additional processing on the object, or to make updates to related objects.Examples:
• When a photo is imported into PostCMS, a trigger could be used to automatically crop and resize it, and create thumbnail images
• When a new blog post is published, a trigger could check whether an archive page already existed for the month the post is in, and if not create one.
• When the home page is updated, a trigger could send an email to the site administrator to ask that they approve the page for publication.
These are just some of the possibilties. Careful use of workflow triggers can considerably reduce repetitive work for your site's content authors.



