# Invoke by ID <VersionBadge version="v0.3.0+" />
Source: https://www.inngest.com/docs/reference/python/steps/invoke_by_id

Calls another Inngest function, waits for its completion, and returns its output.

This method behaves identically to the [invoke](/docs/reference/python/steps/invoke) step method, but accepts an ID instead of the function object. This can be useful for a few reasons:
- Trigger a function whose code is in a different codebase.
- Avoid circular dependencies.
- Avoid undesired transitive imports.

## Arguments

<Properties>
  <Property name="step_id" type="str" required>
    Step ID. Should be unique within the function.
  </Property>
  <Property name="app_id" type="str">
    App ID of the invoked function.
  </Property>
  <Property name="function_id" type="str" required>
    ID of the invoked function.
  </Property>
  <Property name="data" type="object">
    JSON-serializable data that will be passed to the invoked function as `event.data`.
  </Property>
  <Property name="user" type="object">
    JSON-serializable data that will be passed to the invoked function as `event.user`.
  </Property>
</Properties>

## Examples

### Within the same app

```py
@inngest_client.create_function(
    fn_id="fn-1",
    trigger=inngest.TriggerEvent(event="app/fn-1"),
)
async def fn_1(ctx: inngest.Context) -> str:
    return "Hello!"

@inngest_client.create_function(
    fn_id="fn-2",
    trigger=inngest.TriggerEvent(event="app/fn-2"),
)
async def fn_2(ctx: inngest.Context) -> None:
    output = ctx.step.invoke_by_id(
        "invoke",
        function_id="fn-1",
    )

    # Prints "Hello!"
    print(output)
```

### Across apps

```py
inngest_client_1 = inngest.Inngest(app_id="app-1")
inngest_client_2 = inngest.Inngest(app_id="app-2")

@inngest_client_1.create_function(
    fn_id="fn-1",
    trigger=inngest.TriggerEvent(event="app/fn-1"),
)
async def fn_1(ctx: inngest.Context) -> str:
    return "Hello!"

@inngest_client_2.create_function(
    fn_id="fn-2",
    trigger=inngest.TriggerEvent(event="app/fn-2"),
)
async def fn_2(ctx: inngest.Context) -> None:
    output = ctx.step.invoke_by_id(
        "invoke",
        app_id="app-1",
        function_id="fn-1",
    )

    # Prints "Hello!"
    print(output)
```