Operate a Workflow

Setup Requirements

  • Set up Inverter Network SDK: Refer to the Quick Start guide for detailed instructions.

  • Deploy a Workflow: Refer to the Deploy a Workflow guide for detailed instructions.

Retrieving a Workflow

Parameters

  1. orchestratorAddress (required): The address of the orchestrator responsible for managing the workflow. This parameter must always be provided.

  2. workflowOrientations (optional): Suggested to be included for end-to-end TypeScript coverage. This parameter provides additional context or configuration for the workflow's orientation.

const { getWorkflow } = sdk

const { 
    orchestrator, 
    authorizer,
    fundingManager,
    optionalModule,
    fundingToken
} = await getWorkflow({
    orchestratorAddress: '0x8a1897E6Fa0236F68f86240C391D2a7bED3Cf85c',
    requestedModules
});

Reading Data

You can read data from any of the modules as shown below. In this example, we are retrieving the totalSupply of the fundingToken:

const totalSupply = await fundingToken.module.read.totalSupply.run();

Writing Data

You can write data to any of the modules as shown below. In this example, we are making a deposit to the funding manager:

const txHash = await fundingManager.write.deposit.run('100', {
    confirmations: 1,
    onHash: (hash) => {console.log(hash)},
    onConfirmation: (receipt) => {console.log(receipt)},
    onApprove: (receipts) => {console.log(receipts)}
});

Last updated