Skip to main content
BlockX combines compute functions with triggers, inputs, and result writes. Use these driver interfaces in Notebooks by default; function.call() also supports reuse inside a Function. See the source for full implementations and low-level interfaces.

Synchronous Function calls

function.call(function_id, *args, timeout=...)

function_id is a saved Function ID, and *args are positional arguments. This example returns 1.5 after you create the example function in Create a Function. timeout is in seconds. In a Notebook, it controls the call deadline. Inside a Function, nested calls are bounded by the parent’s remaining deadline; increasing a child timeout cannot extend the whole execution. Failures raise FunctionInvokeError, with commonly used attributes code, message, retryable, and call_id. See Error codes.

Function descriptor

Function(source_code=None, function_id='', name='', mode='inline')

Provide source code or a Function ID. This object describes a function for task configuration; constructing it does not execute or save the function.

Pipelines and triggers

Trigger(table, func=None, params=None, operator=None, code=None)

Pipeline(triggers, target_table, depends=None, condition=None)

triggers requires at least one source. target_table identifies the destination. depends lists block tables needed by the computation and does not pass them to the function automatically. condition configures conditional writes to a Normal Table. Common BackfillResult attributes: Large backfills may submit asynchronous batch writes. Confirm target write jobs and consensus separately. See Build a Pipeline for a complete runnable configuration.

Custom tasks

InputsCallConfig(func=None, callList=None)

func accepts a Function ID, callable, or Function object. callList is a list of positional argument lists, each producing one call.
Success prints [1.5, 2.0]. Raw result order is not guaranteed to match input order. Include a business ID in returned values when you need to associate results with inputs.

TaskBuilder.build(call_config, handler)

Returns an unsubmitted Task. task.submit(timeout=None) submits and waits, returning TaskResult; timeout is in seconds. Async Python code can use await task.submit_async(timeout=...).

Block task inputs

Each entry in triggerSources uses table, func, params, and an optional operator. SOURCE_ROW marks the position of the source record in the arguments.

Result handlers

For block handlers, block and block_bundle represent different submission forms and should not be mixed. Standard Pipelines choose handlers based on target table type.

Backfill helpers

bundle_height_range(bundle_id) returns the height range covered by a bundle. backfill_block_bundles() supports custom bundle backfills with BlockBundleCallConfigTemplate and a write handler. See GitHub for lower-level configuration and LocalTestService.