How to start a workflow by using a shortcode > Documentation  > Creating Workflows  > How to start a workflow by using a shortcode

How to start a workflow by using a shortcode

JetFlow provides special shortcode that allows you to quickly and easily pull workflow functionality into content any type.

To start the workflow by using shortcode you need to add trigger Run by shortcode into your workflow. To get shortcode you need to save the workflow first. Having done that you will see the shortcode in the settings of the trigger. It looks like this:

To output some content generated by the workflow to the web page (or any other content) with shortcode like above, use Return it, Stop if or Generate HTML actions and specify returning value which will be passed to WordPress to display.

Optionally you can specify shortcode attributes. To get value of these attributes within workflow context use patterns like {ARG[0][attribute]} where the attribute is a particular shortcode attribute. For example, we added shortcode with trigger and specified attributes title and planet like this:

To get value of the title attribute use pattern {ARG[0][title]}, and to get value of the planet attribute use pattern {ARG[0][planet]} respectively.

Using attributes is useful if you want to execute one workflow in different contexts.

You can use any number of different shortcodes and attributes in the content, all workflows will be running independently.

No Comments

Sorry, the comment form is closed at this time.