Developer Docs

Building a Workflow

Before you begin…

It is important to note that workflows are configured in the instance they run in. If you run release your app to beta and production, the workflows you create will not be transferred along with it. You would need to re-create them on each environment in order to see them.

Create a new workflow

  1. Navigate to the Workflows manager in the backend of your application.
  2. Click on the ‘New Workflow’ button.
  3. This will take you to the details page for the workflow you just created. Here you can fill out details about your new workflow.
  4. Make sure you select the entity(s) which you want to associate with this workflow.
  5. Hit the ‘Publish’ button in the bottom right corner.
  6. Your new workflow will now appear in the management page.

Add a state

The states are the different steps or statuses of the workflow which the entity moves through. It is very important that you have at least two states, otherwise the workflow is unable to function correctly.

  1. Open your workflow for editing, and move to the ‘States’ tab in the top-right corner.
  2. Click on the ‘Add a new state’ button to create a new state.
  3. Give it a meaningful name.
  4. Repeat until you have made all the states which you need.

Choose the starting state

Generally, the first state you enter will the one which you want the entities to start with, but if it isn’t, you do have the option of choosing which state should be first. To choose the start state, you need only toggle the large ‘Start’ button (with the flag icon) against the state which should be first.

Add a transition

Once you have two or more states, you can add in transitions between them. The workflow does not assume that the states are sequential, meaning you must add in every transition yourself. Just because they are in a certain order in the list does not mean that is the order the entity will move through.

  1. Choose the state which is the start of the transition (i.e. if you are moving from state A to state B, select A).
  2. Under the ‘Outgoing Transitions’ column, click on the ‘Edit’ button to open the transitions panel.
  3. Switch your focus to the left-hand slideout which should have just appeared.
  4. Click the ‘Add transition’ button to start the creation of a new transition.
  5. In the ‘Transition name’ field, give your transition a name.
  6. Choose the destination state (state B in our sceanrio) from the dropdown of states.
  7. Click the save button at the bottom of the slideout, or click the add button to create a second transition.

Make sure you publish when you have finished editing!

Reviewing the transitions

If you want to check that you have all the correct transitions in place, the outgoing transitions are listed against each state in the list for your perusal. The number of incoming transitions have also been listed, though you cannot see each individual one (this was done to prevent the confusion of having both directions on one page).

Transitioning an entity

If you have enabled a workflow against an entity, it will now appear as a dropdown attribute when you are editing it’s details. To transition it, you need only choose the state from the dropdown provided.

If an entity has multiple workflows associated with it, it will have multiple dropdowns against it.

Was this article helpful?

Thanks for your feedback!

If you would like to tell us more, please click on the link below to send us a message with more details.

Tool:

Generate

Iterate

Bot:

C#Bot

SpringBot

On this page

New to Codebots?

We know our software can be complicated, so we are always happy to have a chat if you have any questions.