Invoke function
This guide explains how developers invoke a deployed function by configuring execution parameters and submitting an execution request. Invocation focuses on providing inputs and selecting execution resources, not on job management or result analysis.
1. Invocation Overview
Invoking a function means executing a specific function version with a given input on a selected provider and device.
Each invocation:
- Executes exactly once
- Uses one function version
- Creates one execution instance (job) internally
Note: Job lifecycle tracking and result inspection are covered in the Job Management guide.
2. Invocation Preconditions
A function can be invoked only if:
- The function status is Ready
- At least one version has been successfully deployed
- The selected provider and device are available
3. Selecting a Function to Invoke
To invoke a function:
- Choose an existing function from the project
- Open the function details view
- Navigate to the Invocation section
The Invocation section is where all execution parameters are defined.
4. Invocation Configuration
Invocation configuration defines where and how the function is executed, and what input is passed to it.
4.1 Provider
Select the compute provider that will execute the function.
Available providers depend on the SDK or runtime template used to create the function.
Examples:
- Qiskit → IBM Quantum, Quapp
- Braket → Amazon Braket, Quapp
Only compatible providers are shown.
4.2 Device
After selecting a provider, choose an execution device.
Devices may include:
- Quantum hardware
- Simulators
Simulator devices typically include “simulator” in their name.
4.3 Shots
Shots specify how many times the quantum circuit is executed.
- Default value: 10
- Must be an integer
Higher shot counts may improve statistical accuracy but increase execution cost.
4.4 Input Payload
The input payload is passed directly to the function’s execution entry point:
processing(invocation_input)
Two input modes are supported:
Form Data
- Input is provided as key–value pairs
- Suitable for structured or simple parameters
Raw Input
Input is provided as a raw value
Supported formats:
- JSON
- String
- Integer
The input format must match how invocation_input is processed in the function code.
5. Invoking the Function
After completing the configuration:
- Submit the invocation request
The system:
- Validates the configuration
- Submits the execution request
- Starts execution using the selected resources
Each invocation request is handled independently.
6. Invocation Notes and Best Practices
- Only Ready functions can be invoked
- Each invocation executes a single function version
- Always verify provider and device availability
- Validate input structure against function logic
- Use minimal shots during development and testing
7. Next Steps
After invocation, developers typically proceed to:
- Monitor execution status
- Inspect execution output
- Analyze results or retry execution
These topics are covered in:
- Platform Guide: Job Management
- Developer Guide: Invoke Function (SDK / API)