Skip to main content
Skip table of contents

Initializing Kanban Cards

Now that we can create a master definition for a Kanban Loop, we need physical (or rather, digital) cards to move through it. We will create a process called "Kanban Loop Initialization".

The business logic for this flow is straightforward:

  1. Check how many Kanban Cards are currently generated for the loop.

  2. Check how many Kanban Cards should be in the loop according to its definition.

  3. Generate any missing Kanban Cards and place them in the Launcher.

Navigate to Configuration Studio ➔ Process Builder ➔ Flows and create a new flow.

image-20260310-115850.png

Step 1: The Start Node

We only need one piece of information to trigger this process: which loop are we initializing?

  • In the Start node, create one Input Variable named id_kanban_loop (Type: Number).

Step 2: Load the Loop Definition

We need to know the target Number_of_cards from the loop's definition. We will use the Load Object node to retrieve this data from the database into our temporary memory.

  • Add a Load Object node and name it Load Kanban Loop.

  • Entity: Select KANBAN_LOOP.

  • Filters: We only want the specific loop we are initializing. Set the filter where id Equals {{datastore.process.Start.id_kanban_loop}}.

  • Limit: Select Single record (since we only expect one loop to match this ID).

image-20260310-121618.png

Step 3: Count Existing Cards

Next, we need to know how many cards already exist. Instead of loading all the card data, we can use a built-in no-code feature to simply count them.

  • Add another Load Object node and name it Load Kanban Cards.

  • Entity: Select KANBAN_CARD.

  • Properties: Check the Count records box. This tells the system to return a simple number instead of a list of objects.

  • Filters: Filter where id_kanban_loop Equals {{datastore.process.Start.id_kanban_loop}}.

image-20260310-121606.png

Step 4: The Decision (If Node)

Now we have two numbers: the expected card count and the actual card count. We use an If node to compare them.

  • Add an If node and name it Enough Kanban Cards.

  • Condition: We want to check if the target number is less than or equal to the existing count. Use this expression:

CODE
{{datastore.process.LoadKanbanLoop.Number_of_cards}} <= {{datastore.process.LoadKanbanCards}}.
  • True Branch: Connect this to an End node. If we have enough cards, the process can safely end.

Step 5: Generate Missing Cards (For Loop)

If the condition is False (we are missing cards), we need to generate them.

  • Connect the False port of the If node to a Loop node named Create Kanban Cards.

  • Type: Select For (since we want to run the loop a specific number of times).

  • Loop Control Parameters: * Start at: 0.

    • Limit: We need to calculate the difference using a simple math expression sub() (subtract). Paste this into the limit field:

    • Step: 1.

CODE
sub(
     {{datastore.process.LoadKanbanLoop.Number_of_cards}},                                                         
     {{datastore.process.LoadKanbanCards}}
)
image-20260310-122833.png

Step 6: Create the Card and its First Location

Inside the Loop, we will add two Create Object nodes.

  1. Create Kanban Card:

  • Entity: KANBAN_CARD

  • Id_kanban_loop: Select the ID from your Start node.

  • Cycle: Set to static value 1.

  • Id_status: Set to static value 1.

image-20260310-123023.png
  1. Create Kanban Position:

  • Entity: KANBAN_CARD_LOCATION

  • Id_kanban_card: Select the ID from the Create Kanban Card node you just made.

  • Location: We want new cards to start in the Launcher, so type the static value Launcher.

image-20260310-123049.png

Close the loop by connecting this second Create node back to the Loop node.

Step 7: End the Process

Connect the "Out" port of your Loop node to an End node. You can name it Kanban cards created.

image-20260310-123155.png

Test It!

Save your process and run the Debugger. Try putting in a loop ID that has 0 cards and requires 5 cards. Watch how the loop automatically runs exactly 5 times and creates the required entities.

image-20260310-115850.png

Next up: ➔ Flow 3: Board Interactions (Move & Release Cards)

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.