Skip to main content

Building Your First Workflow

This step-by-step guide walks you through creating a complete workflow in RocketWave Pulse.

Prerequisites

Before you begin, ensure you have:

  • Access to the Admin Console
  • An organization selected
  • An environment created (e.g., "Development")
  • At least one AI model configured (for prompt entities)

Goal

We'll build a simple workflow that:

  1. Receives a message with type "greeting"
  2. Generates a personalized response using AI
  3. Logs the response and completes successfully

Step 1: Create the Event Entity

The Event entity is the entry point that filters incoming messages.

  1. Open the Admin Console
  2. Select your organization
  3. Select your environment
  4. Go to WorkflowsCanvas

Create the Event

  1. Click the + Event button in the entity palette
  2. Fill in the form:
    • Name: Greeting Event
    • Description: Triggers when message type is greeting
    • Condition Mode: Single Path

Configure the Condition

  1. Click Add Condition

  2. Set:

    • Field: message.type
    • Operator: equals
    • Value: greeting
  3. Click Save

The entity is now created and appears in your entity library.


Step 2: Create the Prompt Entity

The Prompt entity calls an AI model to generate a response.

Create the Prompt

  1. Click the + Prompt button
  2. Fill in:
    • Name: Generate Greeting Response
    • Description: Creates a friendly response to the greeting
    • Model: Select your configured AI model

Write the Prompt Template

In the prompt text area, enter:

You are a friendly assistant. Someone just said hello to you.

Their message: {{message.content}}
Their name: {{message.userName}}

Respond with a warm, personalized greeting. Keep it brief (1-2 sentences).
  1. Click Save

Step 3: Create the Action Entity

The Action entity executes JavaScript code - we'll use it to log the AI response.

Create the Action

  1. Click the + Action button
  2. Fill in:
    • Name: Log Response
    • Description: Logs the AI-generated response

Write the Script

In the script editor, enter:

// Get the AI response from the previous prompt
const response = await latestPromptResponse();

// Log it for debugging
print('Generated response:', response);

// Optionally pass data to the next node
output = {
response: response,
processedAt: new Date().toISOString()
};
  1. Click Save

Step 4: Build the Workflow

Now we connect the entities on the canvas.

Create a New Workflow

  1. Click New Workflow in the top bar
  2. Enter:
    • Name: Greeting Responder
    • Description: Responds to greeting messages

Add Nodes to Canvas

  1. Drag Greeting Event from the entity palette to the canvas
  2. Drag Generate Greeting Response to the right of the event
  3. Drag Log Response to the right of the prompt

Connect the Nodes

  1. Hover over the Greeting Event node - you'll see an output port
  2. Click and drag from the output port to the input port of Generate Greeting Response
  3. Repeat to connect Generate Greeting ResponseLog Response

Your canvas should look like:

⭕ Greeting Event → 🧠 Generate Greeting Response → ⭐ Log Response

Save the Workflow

  1. Click Save in the top bar
  2. Toggle Active to enable the workflow

Step 5: Test the Workflow

Send a Test Message

You can test by sending a message to your Kinesis stream or using the Chat API:

{
"type": "greeting",
"content": "Hello there!",
"userName": "David",
"organizationId": "your-org-id",
"environmentId": "your-env-id"
}

Check the Logs

  1. Go to Processed Messages in the Admin Console
  2. Look for your message in the Success tab
  3. Check the logs for the print() output

Understanding Workflow Outcomes

When a workflow completes, its outcome is determined automatically:

OutcomeWhen it occurs
SuccessWorkflow completes without errors
Error/FailA script throws an error or times out
IgnoreEvent condition doesn't match the message

You don't need a special "result" node - just ensure your Action scripts handle errors gracefully.


Understanding the Workflow Data

When you save the workflow, it creates this workflowData structure:

{
"nodes": {
"n1": {
"entityId": "greeting-event-uuid",
"name": "Greeting Event",
"entityType": "event",
"tfCondition": "Single Path",
"presentation": {
"type": "circle",
"position": { "x": 100, "y": 200 }
}
},
"n2": {
"entityId": "prompt-uuid",
"name": "Generate Greeting Response",
"entityType": "prompt",
"presentation": {
"type": "brain",
"position": { "x": 350, "y": 200 }
}
},
"n3": {
"entityId": "action-uuid",
"name": "Log Response",
"entityType": "action",
"presentation": {
"type": "star",
"position": { "x": 600, "y": 200 }
}
}
},
"connectors": {
"c1": {
"source": "n1",
"target": "n2",
"sourcePort": "out",
"targetPort": "in"
},
"c2": {
"source": "n2",
"target": "n3",
"sourcePort": "out",
"targetPort": "in"
}
},
"workflow": {
"ref": "n1",
"children": [
{
"ref": "n2",
"children": [
{
"ref": "n3",
"children": []
}
]
}
]
}
}

Adding Branching

To add True/False branching to your event:

1. Edit the Event

  1. Click on the Greeting Event node
  2. Change Condition Mode to True/False
  3. Save the entity

2. Add Logic Branches

When an event is set to True/False:

  1. Two logic branch nodes automatically appear: true and false
  2. Connect subsequent nodes to these branches

3. Handle Both Paths

  • true branch: Connect to nodes that handle matching messages
  • false branch: Can be left empty (message will be ignored) or connect to nodes for non-matching logic

Using Iterable Mode for Array Processing

Iterable mode allows you to process each item in an array separately. This is useful for batch operations.

Configure Iterable Event

  1. Create or edit an Event
  2. Set Logic Path Mode to Iterable
  3. Set Logic Field to the array path (e.g., message.recipients)

Example Configuration:

{
"name": "Process Each Order Item",
"tfCondition": "Iterable",
"logicField": "message.order.items"
}

Access Current Item in Scripts

In downstream Prompts and Actions, use ___iterableItem___:

// In Action script
const currentItem = ___iterableItem___;

// Example: processing order items
print('Processing item:', currentItem.name);
print('Price:', currentItem.price);
print('Quantity:', currentItem.quantity);

// Build output
output = {
itemId: currentItem.id,
processed: true,
timestamp: new Date().toISOString()
};

Iterable Use Cases

Use CaseLogic FieldDescription
Batch Notificationsmessage.recipientsSend notification to each recipient
Order Processingmessage.order.itemsProcess each item in an order
Multi-Platform Postingmessage.platformsPost to multiple social platforms
Bulk Data Processingmessage.recordsProcess each record in a batch

Visual Indicator

On the workflow canvas, Iterable connections display with a special marker (loop icon) to indicate the iteration behavior.


Troubleshooting

Event not triggering

  • Check the condition matches your message format
  • Verify the workflow is Active
  • Check that organizationId and environmentId match

Prompt returning empty

  • Verify the AI model is configured correctly
  • Check the model has valid credentials
  • Review the prompt template for syntax errors

Action script errors

  • Check the browser console and server logs
  • Ensure you're using await with async functions
  • Verify variable names match the injected functions

Workflow not saving

  • Ensure all nodes are connected
  • Every workflow needs at least one Event
  • Check for circular connections (not allowed)

Next Steps

Now that you've built a basic workflow, try:

  1. Add more complexity - Use True/False branching to handle different scenarios
  2. Integrate external services - Post to Mastodon, store in S3, query Pinecone
  3. Chain AI calls - Use multiple prompts in sequence for complex processing
  4. Use the AI Assistant - Ask it to create entities for you