UiPath Documentation
functions
latest
false
  • Información general
    • Acerca de las funciones
  • Python functions
    • Primeros pasos
    • Building Python functions
    • Accessing platform services
    • Tracing and observability
    • Pruebas y depuración
  • Deploy and run

Functions user guide

Tracing and observability

The @traced decorator makes individual execution steps visible in job traces and Maestro dashboards. Use it to annotate the helper functions that do meaningful work, so you can see where time is spent and where a run failed.

from uipath.tracing import traced


@traced(name="fetch_document", run_type="uipath")
def fetch_document(document_id: str) -> bytes:
    # implementation
    ...


def main(input: Input) -> Output:  # do not trace the entry point
    content = fetch_document(input.document_id)
    return Output(result_id="123")
from uipath.tracing import traced


@traced(name="fetch_document", run_type="uipath")
def fetch_document(document_id: str) -> bytes:
    # implementation
    ...


def main(input: Input) -> Output:  # do not trace the entry point
    content = fetch_document(input.document_id)
    return Output(result_id="123")
Importante:

Do not apply @traced to the entry-point function. The runtime already wraps the entire job in its own span; tracing the entry point produces a duplicate, nested span.

What gets captured

Each traced step records its name, run type, start and end times, and status. Traces are linked to the Orchestrator job so you can navigate from a Maestro process instance down to the individual function step that ran.

Guidance

  • Trace the steps that represent distinct units of work — an external call, an extraction, a transformation.
  • Use a clear, stable name per step so traces are easy to read across runs.
  • Keep run_type="uipath" for platform steps.

Próximos pasos

  • What gets captured
  • Guidance
  • Próximos pasos

¿Te ha resultado útil esta página?

Conectar

¿Necesita ayuda? Soporte

¿Quiere aprender? UiPath Academy

¿Tiene alguna pregunta? Foro de UiPath

Manténgase actualizado