Skip to main content

What are Blocks?

Blocks are the fundamental building units of an IronBullet pipeline. Each block represents a single operation - making an HTTP request, parsing data, checking conditions, or manipulating variables.
Think of blocks like Lego pieces: individual components that snap together to create complex automation workflows.

Block Structure

From src/pipeline/block/mod.rs:43-66:
pub struct Block {
    pub id: Uuid,
    pub block_type: BlockType,
    pub label: String,
    pub disabled: bool,
    pub safe_mode: bool,
    pub settings: BlockSettings,
}

Core Properties

PropertyTypeDescription
idUUIDUnique identifier for this block instance
block_typeBlockTypeWhat kind of operation this block performs
labelStringHuman-readable name displayed in UI
disabledBooleanIf true, block is skipped during execution
safe_modeBooleanIf true, errors don’t halt the pipeline
settingsBlockSettingsType-specific configuration

Block Categories

From src/pipeline/block/mod.rs:213-227, blocks are organized into categories:

Requests

  • HttpRequest
  • TcpRequest
  • UdpRequest
  • FtpRequest
  • SshRequest
  • ImapRequest
  • SmtpRequest
  • PopRequest

Parsing

  • ParseLR
  • ParseRegex
  • ParseJSON
  • ParseCSS
  • ParseXPath
  • ParseCookie
  • LambdaParser

Checks

  • KeyCheck

Functions

  • StringFunction
  • ListFunction
  • CryptoFunction
  • ConversionFunction
  • DateFunction
  • FloatFunction
  • IntegerFunction

Control Flow

  • IfElse
  • Loop
  • Delay
  • Script
  • CaseSwitch
  • Group

Bypass/Sensors

  • CaptchaSolver
  • CloudflareBypass
  • DataDomeSensor
  • AkamaiV3Sensor
  • XacfSensor

Browser

  • BrowserOpen
  • NavigateTo
  • ClickElement
  • TypeText
  • WaitForElement
  • GetElementText
  • Screenshot
  • ExecuteJs

Utilities

  • Log
  • SetVariable
  • ClearCookies
  • Webhook
  • WebSocket
  • RandomUserAgent
  • RandomData
  • Plugin

File System

  • FileSystem

Example Block Configuration

From configs/example.rfx:16-39:
{
  "id": "10000000-0000-0000-0000-000000000001",
  "block_type": "HttpRequest",
  "label": "Login Request",
  "disabled": false,
  "safe_mode": false,
  "settings": {
    "type": "HttpRequest",
    "method": "POST",
    "url": "https://httpbin.org/post",
    "headers": [
      ["Content-Type", "application/json"],
      ["Accept", "application/json"]
    ],
    "body": "{\"email\":\"<input.USER>\",\"password\":\"<input.PASS>\"}",
    "body_type": "Raw",
    "content_type": "application/json",
    "follow_redirects": true,
    "timeout_ms": 10000
  }
}

Safe Mode

When safe_mode is false (default), any error in the block will immediately halt execution and mark the data entry as ERROR.
Enable safe_mode on blocks that might legitimately fail (like optional cookie parsing) to allow the pipeline to continue.
From src/pipeline/engine/mod.rs:200-215:
match result {
    Ok(()) => {
        // Block succeeded - continue
    }
    Err(e) if block.safe_mode => {
        // Safe mode: log error but continue execution
        self.log.push(LogEntry {
            message: format!("[SAFE MODE] {}", e),
            ...
        });
    }
    Err(e) => {
        // Not safe mode: halt execution
        self.status = BotStatus::Error;
        return Err(e);
    }
}

Execution Order

Blocks execute sequentially in the order they appear in the pipeline. From src/pipeline/engine/mod.rs:155-228:
Each block can access variables set by previous blocks. Variable state carries forward through the entire execution.

Block-Specific Settings

HttpRequest Settings

From src/pipeline/block/settings_http.rs:23-72:
pub struct HttpRequestSettings {
    pub method: String,              // GET, POST, PUT, DELETE, etc.
    pub url: String,                 // Supports variable interpolation
    pub headers: Vec<(String, String)>,
    pub body: String,
    pub body_type: BodyType,         // None, Raw, FormUrlEncoded, FormData
    pub content_type: String,
    pub follow_redirects: bool,
    pub max_redirects: u32,
    pub timeout_ms: u64,
    pub response_var: String,        // Where to store response (default: SOURCE)
    pub ssl_verify: bool,
    pub tls_client: TlsClient,       // AzureTLS or RustTLS
    pub browser_profile: String,     // chrome, firefox, safari, edge
    pub ja3_override: String,        // Per-block JA3 fingerprint
    pub http2fp_override: String,    // Per-block HTTP/2 fingerprint
}
Use response_var to store responses in different variables. For example, setting response_var to "LOGIN" will store the body in LOGIN, status code in LOGIN.STATUS, headers in LOGIN.HEADERS, etc.

ParseJSON Settings

From src/pipeline/block/settings_parse.rs:62-79:
pub struct ParseJSONSettings {
    pub input_var: String,      // Variable containing JSON (default: data.SOURCE)
    pub json_path: String,      // JSONPath query (e.g., "user.email")
    pub output_var: String,     // Where to store result
    pub capture: bool,          // Mark as capture for output
}

KeyCheck Settings

From src/pipeline/block/settings_check.rs:3-47:
pub struct KeyCheckSettings {
    pub keychains: Vec<Keychain>,
    pub stop_on_fail: bool,  // Halt pipeline on Fail status
}

pub struct Keychain {
    pub result: BotStatus,        // Success, Fail, Ban, Retry, Custom
    pub conditions: Vec<KeyCondition>,
    pub mode: KeychainMode,       // And or Or
}

pub struct KeyCondition {
    pub source: String,           // Variable to check (e.g., data.RESPONSECODE)
    pub comparison: Comparison,   // EqualTo, Contains, MatchesRegex, etc.
    pub value: String,            // Value to compare against
}
Example from configs/example.rfx:56-83:
{
  "block_type": "KeyCheck",
  "label": "Check Status",
  "settings": {
    "type": "KeyCheck",
    "keychains": [
      {
        "result": "Success",
        "conditions": [
          {
            "source": "data.RESPONSECODE",
            "comparison": "EqualTo",
            "value": "200"
          }
        ]
      },
      {
        "result": "Fail",
        "conditions": [
          {
            "source": "data.RESPONSECODE",
            "comparison": "EqualTo",
            "value": "401"
          }
        ]
      }
    ]
  }
}

Bot Status Values

From src/pipeline/mod.rs:315-324:
pub enum BotStatus {
    None,      // Not yet determined
    Success,   // Valid hit (account works, target succeeded)
    Fail,      // Invalid (wrong password, not found)
    Ban,       // IP/proxy banned, rate limited
    Retry,     // Temporary error, try again
    Error,     // Fatal error in execution
    Custom,    // User-defined custom status
}

Success

Valid hit - saved to output

Fail

Invalid credential/data

Ban

Proxy/IP banned - triggers proxy rotation

Retry

Temporary error - data re-queued

Error

Fatal execution error

Custom

User-defined status

Block Results

During execution, each block generates a BlockResult stored in the execution context (from src/pipeline/engine/mod.rs:98-127):
pub struct BlockResult {
    pub block_id: Uuid,
    pub block_label: String,
    pub block_type: BlockType,
    pub success: bool,
    pub timing_ms: u64,
    pub variables_after: HashMap<String, String>,
    pub log_message: String,
    pub request: Option<RequestInfo>,
    pub response: Option<ResponseInfo>,
}
This allows you to debug exactly what happened at each step.

Common Patterns

[
  { "block_type": "HttpRequest", "label": "Get Login Page" },
  { "block_type": "ParseLR", "label": "Extract CSRF Token" },
  { "block_type": "HttpRequest", "label": "Submit Login" },
  { "block_type": "KeyCheck", "label": "Check Login Status" }
]
[
  { "block_type": "HttpRequest", "label": "Get Token" },
  { "block_type": "ParseJSON", "label": "Extract Token" },
  { "block_type": "HttpRequest", "label": "API Call with Token" },
  { "block_type": "ParseJSON", "label": "Extract Data" },
  { "block_type": "KeyCheck", "label": "Validate Response" }
]
[
  { "block_type": "HttpRequest", "label": "Make Request" },
  {
    "block_type": "KeyCheck",
    "keychains": [
      { "result": "Retry", "conditions": [{ "source": "data.RESPONSECODE", "comparison": "EqualTo", "value": "429" }] },
      { "result": "Success", "conditions": [{ "source": "data.RESPONSECODE", "comparison": "EqualTo", "value": "200" }] }
    ]
  }
]