The Manual Data Injection stage is useful when you want to manually add custom data to your pipeline results. By specifying the data parameter, you can include any desired key-value pairs in the dictionary. The injected dictionary will be included in the final response by default. However, if you set the save_to_intermediate property to true, the dictionary will be stored in the intermediate response instead.


Additionally, if the expand_result property is set to true, the injected data will be stored directly in the root of the final or intermediate response, without being nested inside a key with the stage name. This can be helpful when you want the injected data to be easily accessible and integrated into the overall response structure.

Properties

PropertyDescriptionDefaultTypeRequired
typeStage class name-stringYes
enableEnable stage for executiontruebooleanNo
nameName for this specific stagestringNo
save_to_intermediateIf true, the result of the stage will be stored in the intermediate instead of the final sectionfalsebooleanNo
expand_resultIndicates if the result of this stage should be expanded into the final data dictionary instead of being appended as usualfalsebooleanNo
ui_onlySection specific for UI configuration that affects the process of the stageobjectNo
halt_on_exceptionIndicates if the pipeline should be interrupted in case of an exceptionfalsebooleanNo
dataDictionary to inject directly into the final responseobjectYes

Example Configuration

_manual = ManualDataInjStage(
    name='manual',
    save_to_intermediate=False,
    expand_result=False,
    data={
        'message': 'This is a manually injected data',
        'count': 10,
        'flag': True
    }
)
  • No labels