Skip to content

IntegerConst 1.0.0

Overview

Misc Beginner

v1.0.0 Sdk

Description

IntegerConst is a simple configuration block that outputs a predefined integer value. It serves as a constant source for numeric data within workflows, allowing you to define static integer values directly in your block configuration. This block is essential for providing fixed numeric constants, counters, thresholds, and other integer-based parameters to other blocks in your workflow.

Key Features: - Static numeric source: Provides unchanging integer output - Configuration-based: Integer value defined at design time - No runtime inputs: Operates independently without external data - Type-safe output: Always returns an integer data type - Consistent value: Always returns the same configured integer

Common Use Cases: - Numeric constants for calculations and formulas - Default timeout values and retry counts - Page sizes and batch limits for data processing - Threshold values for conditional logic - Counter initializations and increment values - Port numbers and configuration IDs

Configuration Options

NameData TypeDescriptionDefault Value
outputintThe integer value to output. Accepts any valid integer including positive numbers, negative numbers, and zeroNone

Inputs

No inputs available.

Outputs

NameData TypeDescription
outputintThe configured integer value exactly as specified in the configuration. No modification or processing is applied to the output

Examples

# IntegerConst Block - Basic Usage
# Define integer constants for common use cases

# Timeout configuration
request_timeout:
  block: IntegerConst
  config:
    output: 30

# Retry count
max_retries:
  block: IntegerConst  
  config:
    output: 3

# Page size for pagination
page_size:
  block: IntegerConst
  config:
    output: 50

# Use the constants in other blocks
api_call:
  block: HTTPRequest
  input:
    timeout: ${request_timeout.output}     # 30
    retries: ${max_retries.output}         # 3

pagination:
  block: PaginateResults
  input:
    page_size: ${page_size.output}         # 50

Error Handling

Type Error TypeError

Cause: Non-integer value provided in configuration

Solution: Ensure the output value is a valid integer, not a float, string, or other data type.

# Bad
output: "123"    # String
output: 123.45   # Float  
output: true     # Boolean

# Good
output: 123      # Integer
Missing Configuration ConfigurationError

Cause: Required 'output' configuration parameter not provided

Solution: Always specify the 'output' parameter with an integer value in the block configuration.

# Required configuration
config:
  output: 42  # Must provide integer value
Value Range Error OverflowError

Cause: Integer value exceeds system limits (extremely rare in Python)

Solution: Python handles arbitrarily large integers, but if you encounter this error, consider if such large numbers are necessary for your use case.

YAML Parsing Error yaml.YAMLError

Cause: Malformed YAML when specifying the integer value

Solution: Ensure proper YAML syntax. Integers don't need quotes in YAML.

# Bad
output: "123"    # Quoted (becomes string)
output: 1,23     # Wrong decimal separator

# Good  
output: 123      # Plain integer
output: -456     # Negative integer
output: 0        # Zero

FAQ

What's the difference between IntegerConst and other numeric blocks?

IntegerConst provides static integer values, while other blocks offer different functionality:

  • IntegerConst: Static integer values (1, 2, 3, -5, 0)
  • StringConst: Text values that might look like numbers ("123")
  • Mathematical blocks: Dynamic calculations and operations
  • Variable blocks: Dynamic values that can change during execution
Can I use floating-point numbers?

No, IntegerConst only accepts whole numbers (integers). For decimal numbers, you would need to use a different approach or convert the value in downstream blocks. Python integers include positive numbers, negative numbers, and zero, but no decimal places.

What's the maximum integer value I can use?

Python handles arbitrarily large integers, so there's no practical upper limit for IntegerConst values. You can use very large numbers like 999999999999999999 without issues, though extremely large numbers might impact performance in mathematical operations.

Can I change the integer value during workflow execution?

No, IntegerConst provides a fixed value that's set at configuration time. If you need dynamic integer values, consider:

  • Using variable blocks that can be updated during execution
  • Mathematical operation blocks for calculations
  • Counter blocks for incrementing values
  • Input blocks that accept runtime values
How do I use negative integers?

Simply prefix the number with a minus sign in the configuration. For example:

config:
  output: -42    # Negative integer
  output: -1     # Negative one  
  output: 0      # Zero (neither positive nor negative)
Can I use hexadecimal or binary numbers?

YAML/JSON configuration typically expects decimal integers. If you need to work with hexadecimal (0xFF) or binary (0b1010) values, convert them to decimal first, or handle the conversion in a downstream processing block.