# Another flow starts it

> Starts when another flow hands it an email with a Run flow step, on the same documents, and lets that flow wait for the result.

Source: https://docs.go-lumen.ai/es/reference/triggers/flow-called

## De un vistazo

| Propiedad | Valor |
| --- | --- |
| **Trigger name** | `flow-called` |
| **Resource** | ClusterTrigger (`lumen.ai/v1alpha1`) |
| **Source** | event |
| **Needs a connection** | no |
| **Produces** | `email`, `file` |
| **Emits** | item |
| **Installation must provide** | nothing |

The trigger goes under `spec.triggers` of a Flow. Its outputs are referenced as `<triggerId>.<field>`. A trigger can also carry a `when` condition ("Start only when") and `disabled: true`.

## Salidas

Un nodo posterior se refiere a una salida como `{nodeId.field}` en un texto, o `nodeId.field` en una condición.

| Salida | Tipo |
| --- | --- |
| `from` | string |
| `to` | string |
| `subject` | string |
| `body` | string |
| `attachments` | number |
| `senderVerified` | boolean |
| `receivedAt` | date |
| `messageId` | string |
| `parentRun` | string |
| `parentFlow` | string |

## Ajustes

Se definen bajo `config:` en el disparador del flujo.

| Ajuste | Tipo | Valor por defecto | Descripción |
| --- | --- | --- | --- |
| `accepts` | string | `"email"` | Accepts is what the flow takes from the flow that calls it. Only email in this version: the caller's documents, with the email they came in. (one of email) |

El JSON Schema completo de estos ajustes: [flow-called.schema.json](https://docs.go-lumen.ai/schemas/triggers/flow-called.schema.json).

## Úsalo en un flujo

```yaml title="flow.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: flow-called-example
  namespace: tenant-acme
spec:
  displayName: "Another flow starts it"
  triggers:
    - id: start
      ref: {name: flow-called}
      next: [notify-in-app]
  nodes:
    - id: notify-in-app
      stepRef: {name: notify-in-app}
      config:
        body: 'Total: {total}'
        title: New invoice from {supplier}
        to: admins
```
