# CHANGELOG

## 2.7.1
- **[bugfix] No longer allow a block with both a `code` and a `script_ref` input, as this can result in confusing behavior**
- **[improvement] `Block.output()` and `workflow_input()` return types adjusted to allow smoother typechecking experience for block definitions**

## 2.7.0
- **[feature] Hyperscience Platform V43 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v43)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v43)
- **[improvement] Generated flow JSON now includes an `sdk_version` field in the metadata section**
- **[improvement] `MockHsBlockInstance.log()` now correctly reflects the difference in logging behaviour between Python versions — see [HsBlockInstance.log](https://flows-sdk.hyperscience.ai/pages/source-docs.html#flows_sdk.types.HsBlockInstance.log) and [Unit Testing Custom Code Blocks](https://flows-sdk.hyperscience.ai/pages/testing.html#unit-testing-ccbs) for more details**
  - In `PythonBlock` with Python version <= 3.12, logging arguments via `HsBlockInstance.log()` is not supported
  - In `PythonBlock` with Python version >= 3.13, logging arguments is supported
- **[deprecated] `FOLDER_TRIGGER` has been deprecated across multiple IDP versions in favor of the Universal Folder Listener**
- **[bugfix] Fixed `BundleExporter` hardcoding Python code block identifiers, which prevented correct export of flows using newer `PythonBlock` versions**
- **[bugfix] Fixed unstable ordering of roles across IDP versions V38–V42**

## 2.6.0
- **[feature] Hyperscience Platform V42.3 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v42)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v42)
- **[feature] In V42.3+ a new Document Processing with ORCA Subflow has been added for Advanced and Premium license**
  - **IDP ORCA Flow** - a read-only subflow similar to **IDP Core Flow** but ORCA is used for field identification
  - **ORCA QA Flow** - Quality assurance for ORCA flow. Meant to be used together with IDP ORCA Flow to spawn QA tasks for human review

## 2.5.1
- **[bugfix] Fix MockHsBlockInstance.log function having an outdated signature**

## 2.5.0
- **[feature] Hyperscience Platform V42.2 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v42)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v42)

## 2.4.2
- **[bugfix] Allow Code Blocks to use static methods and class methods**

## 2.4.1
- **[feature] Added support for using entire modules as code in Code Blocks.**
  - Module-backed CCBs enable better code organization, maintainability, and testability
  - For further details see the [`PythonBlock`](https://flows-sdk.hyperscience.ai/pages/source-docs.html#flows_sdk.blocks.PythonBlock) documentation
- **[feature] Comprehensive unit testing support for Custom Code Blocks**
  - Added `MockHsBlockInstance` and `MockHsTask` classes in `flows_sdk.mocks` for testing CCBs locally
  - Mock objects simulate blob storage, logging, HTTP requests, and measurements
  - See the new [Unit Testing Custom Code Blocks](https://flows-sdk.hyperscience.ai/pages/testing.html#unit-testing-ccbs) guide for more details and examples
- **[improvement] Added comprehensive documentation for several flow utilities**
  - Added docstrings with code examples for `workflow_input()`, `FlowDefinitionReferences`, and `FlowRunReferences`

## 2.4.0
- **[feature] Hyperscience Platform V42.1 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v42)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v42)
- **[improvement] The On-Error flows have been split in two parts:**
  - The On-Error flow that is configured on the main flow, which is responsible for handling the error and calling the On-Error subflow
  - The On-Error subflow, which is responsible for generating the error message to be sent to the output blocks
  - Similarly to the Document processing flows, this allows for better separation of concerns and updating the on-error logic without losing any configure output blocks.

## 2.3.0
- **[improvement] Added support for the Python 3.13 `PythonBlock`**

## 2.1.0
- **[feature] Hyperscience Platform V42 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v42)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v42)

## 2.0.0
- [breaking change] Upgrade to Python 3.12 - using blocks from V41 now requires a 3.12 venv
- [feature] [Updated blocks for V41.2](https://flows-sdk.hyperscience.ai/pages/idp.html#v41)

## 1.11.3
- **[feature] Backport to [V40 IDP Library](https://flows-sdk.hyperscience.ai/pages/idp.html#v40) the support for forcing normalization errors and blank or missing fields to supervision**

## 1.11.2
- **[improvement] Added support for empty branches in `Routing` and `Fork` blocks:**
  - Allow empty branches (branches without any blocks)
  - Allow branches to define an output from an external block, without requiring any blocks to run.**

## 1.11.1
- **[improvement] Updated documentation for chat component for LLM Document Q&A in [Custom Supervision](https://flows-sdk.hyperscience.ai/pages/custom_supervision.html)**

## 1.11.0
- **[feature] Hyperscience Platform V41 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v41)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v41)

## 1.10.5
- **[feature] Refer to the business metric measurement occurrence time via `time`, a datetime object. This datetime must be timezone-aware**

## 1.10.4
- **[feature] Added `FileFilterBlock` to [V40 IDP Library](https://flows-sdk.hyperscience.ai/pages/idp.html#v40)**

## 1.10.3
- **[feature] Added publish measurements method to HsBlockInstance that allows code in PythonBlock**
or CodeBlock to tracks business metrics (available since V41)

## 1.10.2
- **[improvement] Added support for the Python 3.12 `PythonBlock`**

## 1.10.1
- **[feature] Added utility methods to HsBlockInstance for making authenticated requests to the**
**Hyperscience instance from inside the code in PythonBlock or CodeBlock (available since R40.2)**

## 1.10.0
- **[feature] Hyperscience Platform V40 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v40)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v40)
- **[bugfix] Removed default Submission Aware On Error flow from V38 examples because it might not**
**exist in a V38 system.**

## 1.9.1
- **[bugfix] Updated default inputs for `ReprocessingBlock` in versions 39 and 39.1, so that additional inputs in custom IDP_CORE flows would get relayed for reprocessing runs**

## 1.9.0
- **[feature] Hyperscience Platform V39.1 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v39-1)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v39-1)
- **[improvement] Roles are exposed as an argument to the IDP Core Block**
- **[improvement] Easier to see where to modify Notification, On Error flows in the**
**Document Processing example flow**
- **[improvement] Default Notification flow, On Error flow, and IDP Core block in the example flow**
**point to the out-of-the-box flows in the platform**

## 1.8.3
- **[bugfix] Reverted the change introduced in Flows SDK version 1.8.2 where the default value for**
**`PythonBlock#python_version` is set to Python 3.11, which caused breaking behaviour.**
- **[improvement] Added support for an environment variable `HS_PYTHON_CODE_BLOCK_PYTHON_VERSION`**
**that allows overriding the default behaviour _without_ having to make code changes to**
**existing flows.**
  - To understand how to control Python versions for `PythonBlocks`, Please refer to the
  [PythonBlock documentation](https://flows-sdk.hyperscience.ai/pages/source-docs.html#flows_sdk.blocks.PythonBlock)

## 1.8.2
- **[bugfix] Default version of PythonBlock is now Python 3.11, instead of 3.9**

## 1.8.1
- **[improvement] Ported quality of life features introduced in the V39 samples to V38 samples**
  - Roles are exposed as an argument to the IDP Core Block
  - Easier to see where to modify Notification, On Error flows in the
    Document Processing example flow for V38
  - Default Notification flow, On Error flow, and IDP Core block in the example V38 flow
    point to the out-of-the-box flows in the platform for that version
- **[improvement] Moved IDPWrapperManifest out of the example Document Processing flow samples for**
**both V38 and V39**
- **[improvement] Added parameter that controls which Python version a `PythonBlock` works with**

## 1.8.0
- **[feature] Hyperscience Platform V39 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v39)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v39)
- **[improvement] Roles are exposed as an argument to the IDP Core Block**
- **[improvement] Easier to see where to modify Notification, On Error flows in the**
**Document Processing example flow**
- **[improvement] Default Notification flow, On Error flow, and IDP Core block in the example flow**
**point to the out-of-the-box flows in the platform**

## 1.7.2
- Bump asttokens to 2.4.1

## 1.7.1
- **[bugfix] Default CustomSupervision’s notification_workflow to None**
- **[improvement] Add release.zip to the idp v38 starter flow**
- **[improvement] Properly identify settings as Classification settings**

## 1.7.0
- **[feature] Hyperscience Platform V38 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v38)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v38)

## 1.6.4
- **[feature] Add support for `on_error_flow` construct in error handling.**
  - Can be used only in the flow level error handling section
  - Available in Hyperscience Platform V38 and above.

## 1.6.3
- **[feature] Add support for `compatibility_spec` construct in blocks.**
  - Available in Hyperscience Platform V38 and above.

## 1.6.2
- **[bugfix] Remove extra parameter http_config from SubmissionBootstrap block for R32.**

## 1.6.1
- **[improvement] Setting a range for pydantic between `1.10.11` inclusive and `2.0` non-inclusive.**

## 1.6.0
- **[feature] Hyperscience Platform V37 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v37)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v37)

## 1.5.2
- **[improvement] Updated pydantic version to `1.10.8`.**

## 1.5.1
- **[bugfix] Added missing `http_config` parameter to `SubmissionBootstrapBlock`.**
- **[improvement] Updated documentation for I/O blocks.**

## 1.5.0
- **[feature] Hyperscience Platform V36 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v36)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v36)

## 1.4.1
- **[feature] Decision dependencies for Custom Supervision is available!**
- **[feature] Mandatory decisions for Custom Supervision is also available!**

## 1.4.0
- **[feature] Hyperscience Platform V35 has been released!**
  - [updated blocks](https://flows-sdk.hyperscience.ai/pages/idp.html#v35)
  - [starter examples](https://flows-sdk.hyperscience.ai/pages/examples.html#v35)
  - Check out some of the new features v35 features, released in recent flows-sdk versions:
    - PythonBlock, how to store and load binary data, use 3rd party libraries and more [in 1.1.0](https://flows-sdk.hyperscience.ai/pages/CHANGELOG.html#id44)
    - How to use structured logging, also visible in the UI [in 1.3.0](https://flows-sdk.hyperscience.ai/pages/CHANGELOG.html#id41)
- **[feature] A new system block has been introduced - Foreach!**
  - This block enables dynamic parallelization of tasks - [check out the docs to learn more](https://flows-sdk.hyperscience.ai/pages/source-docs.html#flows_sdk.blocks.Foreach)

## 1.3.0
- **[improvement] Added a `log` method to `HsBlockInstance`**

## 1.2.1
- **[improvement] A reference to the code function passed to `CodeBlock` and `PythonBlock` is now available on the block object under `block.code_fn`**

## 1.2.0
- **[feature] Hyperscience Platform V34 has been released!**
  - **[feature] New block - HyperscienceRestApiBlock available for V32, V33, and V34**
- **[deprecated] Removed the Kofax Folder Listener IOBlock**

## 1.1.0
- **[feature] Added a new block - PythonBlock**

> This requires a Hyperscience platform version `34.0.0+`

PythonBlock is a special type of block that can execute custom python code on the Hyperscience platform. Similarly to CodeBlock, the code can utilize packages that are part of the Python Standard Library, but it also allows developers to utilize third-party python packages.

- **[feature] Introduces HsTask and HsBlockInstance system arguments for code blocks**

> This requires a Hyperscience platform version `35.0.0+`

## 1.0.1
- **[improvement] new properties for v32 `CaseCollationBlock` and v33 `MachineCollationBlock`**

## 1.0.0
- **[improvement] `reference_name` is now an optional property for all blocks.**
