> For the complete documentation index, see [llms.txt](https://docs.inverter.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inverter.network/sdk/react-sdk/operate-a-workflow.md).

# Operate a Workflow

## **Setup Requirements**

* **Set up Inverter Network SDK**: Refer to the[ Quick Start](/sdk/react-sdk.md) guide for detailed instructions.
* **Deploy a Workflow**: Refer to the[ Deploy a Workflow](/sdk/react-sdk/deploy-a-workflow.md) guide for detailed instructions.

{% hint style="info" %}
*( optional )* You can pass in a ModuleData typed object into the `requestedModules` constant's fields, this makes it so that you can work with your self managed inverter modules
{% endhint %}

```typescript
// EXEMPLE MixedRequestedModules USAGE
import type { ModuleData, MixedRequestedModules } from '@inverter-network/sdk'

const AUT_Roles_v1 = {'<your_module_data>'} as const satisifies ModuleData

const requestedModules = {
    fundingManager: 'FM_DepositVault_v1',
    paymentProcessor: 'PP_Simple_v1',
    authorizer: AUT_Roles_v1,
} as const satisfies MixedRequestedModules
```

***

## Retrieving a Workflow

We strongly recommend passing in a `readonly requestedModules` since this ensures that your `workflow` response will be strongly typed. Also you will have to pass in a `orchestratorAddress` in to the query.

**Parameters**

* **`requestedModules` (required)**:\
  This parameter defines the modules which will be deployed.
* `useTags` **(optional):**\
  This parameter is to optionally disable auto format parse for inputs and outputs (default true).

{% code overflow="wrap" %}

```typescript
'use client'

import { useWorkflow } from '@inverter-network/react/client'
import type { MixedRequestedModules } from '@inverter-network/sdk'

import { Button } from '@/components/ui/button'
import { useMutation } from '@tanstack/react-query'

// Defined the modules to be used in the workflow in typesafe manner
const requestedModules = {
  fundingManager: 'FM_DepositVault_v1',
  paymentProcessor: 'PP_Simple_v1',
  authorizer: 'AUT_Roles_v1',
  optionalModules: ['LM_PC_Bounties_v1'],
} as const satisfies MixedRequestedModules

export default function Page() {
  const workflow = useWorkflow({
    orchestratorAddress: '<your_orchestrator_address>',
    requestedModules,
  })

  // Setup a read mutation to run the workflow function
  const readTitle = useMutation({
    mutationFn: async () => {
      if (!workflow.data) throw new Error('No workflow instance found')

      return await workflow.data.fundingManager.read.title.run()
    },
  })
  
  // Setup a write mutation to run the workflow function
  const deposit = useMutation({
    mutationFn: async () => {
      if (!workflow.data) throw new Error('No workflow instance found')

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

  // Return a simple ui to trigger the flow
  return (
    <form
      className="w-screen h-screen flex flex-col items-center justify-center gap-3"
      onSubmit={(e) => {
        e.preventDefault()
        readTitle.mutate()
        deposit.mutate()
      }}
    >
      <h1>Funding Manager Title: {readTitle?.data ?? 'No Data Yet...'}</h1>
      
      <h1>Deposit Transaction Hash: {deposit?.data ?? 'No Data Yet...'}</h1>

      <Button type="submit" loading={readTitle.isPending}>
        Read
      </Button>
    </form>
  )
}
```

{% endcode %}
