> 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/simulate-a-workflow.md).

# Simulate a Workflow

## **Setup Requirements**

1. **Set up Inverter Network SDK**: Refer to the[ Quick Start](/sdk/react-sdk.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
```

***

## Simulating the Workflow

All we have to do is decide on the `requestedModules` and we can display or use the output of the simulation. This simulation lets us retrieve the preliminary addresses of a workflow before it is deployed.

**Parameters**

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

{% code overflow="wrap" %}

```typescript
'use client'

import { useGetSimulatedWorkflow } from '@inverter-network/react/client'
import type {
  MixedRequestedModules,
  GetDeployWorkflowArgs,
} from '@inverter-network/sdk'
import { useAccount } from 'wagmi'

import { Spinner } from '@/components/ui/spinner'

// Defined the modules to be deployed 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 { address } = useAccount()
  
  // Define the args for the modules in typesafe manner
  const args = {
    fundingManager: {
      orchestratorTokenAddress: '<your_funding_token_address>',
    },
    authorizer: {
      initialAdmin: address,
    },
  } as const satisfies GetDeployWorkflowArgs<typeof requestedModules>
  
  const { data, isPending } = useGetSimulatedWorkflow({ requestedModules, args })
  
  if (isPending) return (
    <div className="w-screen h-screen flex flex-col items-center justify-center">
      <Spinner />
    </div>
  )

  // Return a simple ui to display the results
  return (
    <div className="w-screen h-screen flex flex-col items-center justify-center gap-3">
      <h1>Orchestrator Address: {data?.orchestratorAddress}</h1>

      <h1>Authorizer Address: {data?.authorizerAddress}</h1>
      
      <h1>Funding Manager Address: {data?.fundingManagerAddress}</h1>
      
      <h1>Payment Processor Address: {data?.paymentProcessorAddress}</h1>
      
      <h1>Logic Module Addresses: {data?.logicModuleAddresses.join(', ')}</h1>
      
      <h1>Deployment Bytecode: {data?.bytecode.slice(0, 100)}...</h1>
      
      <h1>Trusted Forwared Address: {data?.trustedForwarderAddress}</h1>
      
      <h1>Factory Address: {data?.factoryAddress}</h1>
    </form>
  )
}
```

{% endcode %}
