What are Steps?

Steps are the individual building blocks that make up your workflow. Each step represents a specific action - it could be using AI to analyze text or images, making an API call to another service, or processing data in some way. When connected together in sequence, steps transform your input data into meaningful output by each performing their designated task.

Step Types

Cortex provides a variety of powerful step types to build your workflow:

  • Model: Interact with AI models (LLMs) for text analysis, content generation, image understanding, and intelligent data processing
  • HTTP Request: Send HTTP requests to external APIs and web services
  • Browser: Extracts data from web pages
  • Code: Write and execute custom JavaScript code to transform data and implement complex logic

Each step type serves a specific purpose, allowing you to combine them like building blocks to create powerful automated workflows tailored to your needs.

Simple Example: Customer Feedback Analysis

Watch the video below to see customer feedback analysis in action. The video demonstrates how data flows from the input, through each step, and ultimately generates the final output.

Let’s look at a practical workflow that helps customer service teams analyze customer feedback:

  1. The customer service team enters customer feedback into an Input text field
  2. A Model step uses GPT-4 to analyze the sentiment (positive, negative, neutral)
  3. Another Model step extracts specific product features mentioned
  4. A final Code step generates a formatted report with:
    • Overall sentiment score
    • Key product features discussed
    • Actionable recommendations

Here’s how the data flows through each step:

  • Customer feedback flows from Input to the sentiment analysis Model step
  • The sentiment results pass to the feature extraction Model step
  • All the collected data flows to the Code step to create the final report

This modular approach allows you to build complex workflows by combining simple, focused steps.

Creating Steps

Let’s quickly look at how to create steps. We’ll cover each step type in more depth in the next section.

There are three ways to add steps:

  1. If you’re starting with an empty workflow:

    • Click the Add Step button that appears below the Input
    • Select the step type you want to add
    • This will create a new step and automatically connect it to the Input
  2. If you already have steps and want to connect a new one:

    • Locate the small circle in the top-right corner of an existing step
    • Click and drag the circle
    • Release to open a dropdown menu
    • Select Add Step from the menu
    • Choose the step type you want to add
    • The new step will be added and automatically connect to the step you dragged from
  3. If you want to add a step without automatic connections:

    • Right-click anywhere in the canvas
    • Select Add Step from the dropdown menu
    • Choose the step type you want to add
    • The step will be added at the clicked location without any connections

Renaming Steps

Steps are automatically named with a unique identifier (e.g., “MODEL_1”).

To rename a step:

  1. Click the step name
  2. Type a new name
  3. Press Enter

Names must be unique and contain only alphanumeric characters and underscores, except for Note steps which can include spaces and special characters:

  • Correct for regular steps: Sentiment_Analysis, ExtractFeatures_1, VALIDATE_INPUT
  • Correct for Note steps: Customer Feedback Notes, Important! Read this, Step 1 - Data Processing
  • Incorrect for regular steps: Sentiment Analysis, Extract-Features, Process_Data!

Executing Steps

To execute a step, you can run the workflow entirely, which will run all the steps in the workflow in sequence, So you can see the output of each step.

Running the Workflow

  1. Click the Run button in the top-right corner of the workflow
  2. The workflow will execute and display the output of each step

Running a Single Step

You can also execute an individual step to see just its output:

  1. Click the play icon button in the step’s header
  2. The step will execute and display its output
  3. After the first execution, the play icon changes to a replay icon that you can click to run the step again

Step Connections

Steps in a workflow need to be connected to define how data flows between them. The workflow always starts with the Input, which provides the initial data that flows through the steps. Here’s how to manage connections:

  1. When adding a new step (as described above), connections are created automatically:

    • The first step will automatically connect to the Input
    • Subsequent steps will connect to the previous step
  2. To manually connect existing steps:

    • Click and drag from the small circle in the top-right corner of a step
    • Drag to the small circle on the top-left of the target step
    • A line will appear showing the connection

Important rules for connections:

  • Circular connections are not allowed in the workflow, as this breaks the left-to-right data flow
  • Each connection represents data flowing from one step to the next
  • A step can receive data from multiple previous steps
  • A step can send its output to multiple next steps

To remove a connection:

  • Click the connection line to delete it

The output data from the previous step becomes available to the connected step, creating a seamless flow of data through your workflow.

Next Steps

Now that you’ve learned about the different types of steps you can add to your workflow and how to add and connect them, let’s explore the options and configurations available for each step type.

You’ve been hearing about data flow, but now you might be wondering how to access input data in your steps and how to use the output from previous steps in subsequent steps.

First, let’s quickly look at each step type and its configuration options.

Then, we’ll dive into:

Data Flow

Learn how data flows between workflow steps, from input fields through processing steps to final output.