Calling Adapter Actions#

If the adapter provides a set of actions, you can call them from Workflows.

  1. Import the stubs file generated from the Artificial extension:

    from stubs_actions import example_adapter_action
    
  2. Call the function inside of Orchestration Python:

    lot_number = await example_adapter_action(barcode="1234")
    

Note

There are restrictions on adapter actions return values and parameters. They can only have one return value. They must be strictly typed and composed of supported types.

from artificial.workflows.decorators import workflow
from artificial.workflows.runtime import show_info
from stubs_actions import example_adapter_action

@workflow('Adapter Action', 'wf_adapter_action', 'lab_c9eae09e-ceed-46d1-8390-87ff7dd8586d')
async def adapter_action() -> None:

    lot_number = await example_adapter_action(barcode="1234")

    await show_info(f'Lot: {lot_number})