# Convert a currency

> Converts an amount at the Bank of Israel's representative rate for the day. A weekend or a holiday uses the last published rate.

Source: https://docs.go-lumen.ai/es/reference/steps/currency-convert

## De un vistazo

| Propiedad | Valor |
| --- | --- |
| **Nombre del paso** | `currency-convert` |
| **Recurso** | ClusterStep (`lumen.ai/v1alpha1`) |
| **Grupo de la paleta, categoría** | control, business |
| **Créditos** | **0.5** créditos cada vez que tiene éxito |
| **Efectos externos** | no |
| **La instalación debe aportar** | nada |

## Entradas

| Propiedad | Valor |
| --- | --- |
| **Necesita** | nada |
| **Produce** | `fields` |
| **Trabaja sobre** | item: un documento cada vez |

Necesita y Produce son tipos de datos (file, text, fields, email). El editor ofrece un paso solo donde lo que necesita ya está en el camino. Consulta [Documentos y datos](https://docs.go-lumen.ai/es/concepts/how-flows-run.md#documents-and-data).

## Salidas

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

| Salida | Tipo |
| --- | --- |
| `converted` | number |
| `rate` | number |
| `rateDate` | date |

## Ajustes

Se definen bajo `config:` en el nodo del flujo. Los ajustes de texto pueden contener marcadores de posición como `{nodeId.field}`.

| Ajuste | Tipo | Valor por defecto | Descripción |
| --- | --- | --- | --- |
| `amount` (obligatorio) | string |  | Amount is the number to convert. (minLength 1; maxLength 64) |
| `from` (obligatorio) | string | `"USD"` | From and To are ISO 4217 codes: ILS or one the Bank of Israel publishes a rate for (fx.Currencies; a test keeps the lists in step). (one of ILS, USD, EUR, GBP, JPY, CHF, AUD, CAD, DKK, NOK, SEK, ZAR, JOD, EGP, LBP) |
| `to` (obligatorio) | string | `"ILS"` | To currency (one of ILS, USD, EUR, GBP, JPY, CHF, AUD, CAD, DKK, NOK, SEK, ZAR, JOD, EGP, LBP) |
| `dateMode` | string | `"latest"` | DateMode says which day the rate is of: latest (the default), date (the day in Date) or field (a day an earlier step found, a placeholder in Date). Left out it follows Date as before: empty is the latest, else the day Date names. (one of latest, date, field) |
| `date` | string |  | Date is the day of the rate, YYYY-MM-DD, or a placeholder for one. A day with no rate (a weekend, a holiday) takes the last one published before it. (maxLength 32) |

El JSON Schema completo de estos ajustes: [currency-convert.schema.json](https://docs.go-lumen.ai/schemas/steps/currency-convert.schema.json).

## Ejemplo

```yaml title="config"
amount: '{amount}'
date: "2026-10-01"
dateMode: date
from: USD
to: ILS
```

## Úsalo en un flujo

Un nodo que ejecuta `currency-convert` va bajo `spec.nodes` de un [Flow](https://docs.go-lumen.ai/es/concepts/how-flows-run.md#the-flow-as-yaml). Dale cualquier id y enumera en next los ids de los nodos siguientes.

```yaml title="flow.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: currency-convert-example
  namespace: tenant-acme
spec:
  displayName: "Convert a currency"
  triggers:
    - id: start
      ref: {name: manual-run}
      next: [currency-convert]
  nodes:
    - id: currency-convert
      stepRef: {name: currency-convert}
      config:
        amount: '{amount}'
        date: "2026-10-01"
        dateMode: date
        from: USD
        to: ILS
```
