TopFlow
LearnBuildSecurity
Entry/Exit Node

Start Node

Entry point for all TopFlow workflows. Defines the initial input and triggers workflow execution. Every workflow must have exactly one Start node.

Overview

The Start Node is the beginning of every workflow. It:

  • Provides the initial input data to downstream nodes
  • Has no input handles (cannot receive data from other nodes)
  • Has one output handle (sends data to connected nodes)
  • Triggers the workflow execution sequence
Use Cases
  • User input - Accept data from end users
  • API trigger - Receive webhook or API request data
  • Static data - Provide hardcoded initial values
  • Demo mode - Pre-populate with sample data for testing

Configuration

Required Parameters

input

  • Type: string
  • Required: No (can be empty for API-triggered workflows)
  • Default: "" (empty string)
  • Description: The initial data passed to downstream nodes
  • Example: "Analyze these security logs..."
Configuration Tips
Keep it simple - The Start node should provide raw, unprocessed data. Use Prompt nodes or JavaScript nodes for transformation.
Test with real data - Use actual examples from your use case, not placeholder text like "foo" or "test".
For APIs - Leave input empty in the visual builder. Pass data via API request body when executing programmatically.

Node Data Interface

TypeScript Definition
export type StartNodeData = {
  // Configuration
  input: string // Initial input data

  // Execution state (managed by system)
  status?: "idle" | "running" | "completed" | "error"
  output?: any
  error?: string
}

Node Props:

import { NodeProps } from "@xyflow/react"

export function StartNode({ data, id }: NodeProps<StartNodeData>) {
  // Component implementation
  return (
    <div className="start-node">
      <Handle type="source" position={Position.Right} />
      {/* Node UI */}
    </div>
  )
}

Usage Examples

Example 1: Static Initial Input
Hardcoded data for consistent testing
const workflow = {
  nodes: [
    {
      id: "start-1",
      type: "start",
      data: {
        input: "Analyze threat intelligence for CVE-2026-1234"
      }
    },
    {
      id: "text-1",
      type: "textModel",
      data: {
        model: "gpt-4",
        prompt: "$input1" // Receives Start node output
      }
    }
  ],
  edges: [
    { id: "e1", source: "start-1", target: "text-1" }
  ]
}
Result: Text Model node receives "Analyze threat intelligence for CVE-2026-1234" as input1
Example 2: API-Triggered Workflow
Dynamic input from API request

Workflow configuration (input left empty):

{
  id: "start-1",
  type: "start",
  data: {
    input: "" // Empty - will be provided via API
  }
}

API execution:

const response = await fetch("/api/execute-workflow", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    workflow: { nodes, edges },
    input: "Real-time security alert from SIEM", // Overrides Start node input
    apiKeys: { openai: "sk-..." }
  })
})
Result: Start node output becomes "Real-time security alert from SIEM"
Example 3: Multiple Downstream Connections
Start node can connect to multiple nodes
const workflow = {
  nodes: [
    {
      id: "start-1",
      type: "start",
      data: { input: "Security incident details" }
    },
    {
      id: "classify-1",
      type: "textModel",
      data: { model: "gpt-4", prompt: "Classify severity: $input1" }
    },
    {
      id: "extract-1",
      type: "textModel",
      data: { model: "gpt-4", prompt: "Extract IOCs from: $input1" }
    }
  ],
  edges: [
    { id: "e1", source: "start-1", target: "classify-1" },
    { id: "e2", source: "start-1", target: "extract-1" } // Same input to both
  ]
}
Result: Both downstream nodes receive identical input from Start node

Validation Rules

Errors (Block Execution)
  • ❌
    Missing Start Node

    Workflow must have exactly one Start node

  • ❌
    Multiple Start Nodes

    Only one Start node allowed per workflow

  • ❌
    Incoming Edges

    Start node cannot have incoming edges (no inputs allowed)

  • ❌
    No Outgoing Edges

    Start node must connect to at least one downstream node

Info Messages
  • ℹ️
    Empty Input

    Start node has empty input. This is valid for API-triggered workflows but may cause issues in demo mode.

Code Generation

Generated TypeScript Code
When exporting workflow to code, Start node becomes function parameter

Workflow Function Export:

// Generated code for workflow function export
export async function runAgentWorkflow(
  initialInput?: string // Start node input becomes parameter
) {
  // Use initialInput or default from Start node configuration
  const startInput = initialInput || "Analyze these security logs"

  // Start node execution (returns input as-is)
  const node_start = startInput

  // Downstream nodes receive `node_start` as input
  const node_textModel = await generateText({
    model: openai("gpt-4"),
    prompt: node_start // $input1 becomes node_start
  })

  return node_textModel.text
}

Route Handler Export:

// Generated code for Next.js API route
export async function POST(req: Request) {
  const { input } = await req.json()

  // Start node input from API request
  const node_start = input || "Default input"

  const node_textModel = await generateText({
    model: openai(process.env.OPENAI_API_KEY),
    prompt: node_start
  })

  return Response.json({ output: node_textModel.text })
}

Best Practices

Do
  • ✓
    Use realistic example data when testing
  • ✓
    Leave input empty for API-triggered workflows
  • ✓
    Connect Start node to multiple branches for parallel processing
  • ✓
    Document expected input format in workflow description
Don't
  • ✗
    Don't create multiple Start nodes
  • ✗
    Don't connect edges TO the Start node (no inputs)
  • ✗
    Don't put complex logic in Start node input (use downstream nodes)
  • ✗
    Don't hardcode sensitive data (use environment variables in exported code)

Related Nodes

End Node
Workflow exit point, collects final output
View Documentation
Prompt Node
Transform Start node output with templates
View Documentation

Next Steps

Continue learning about other node types and workflow patterns:

Text Model NodeView All NodesWorkflow Patterns