# Envoyer des documents dans un Workflow

## Créer un nouveau Job

Pour charger un document dans un Workflow donné, vous avez besoin au minimum de:

* `headers` pour vous authentifier (voir [Authentification](/products/integration-api/authentification.md)).
* `workflow_uuid` (str) ou `workflow_id` (int) :  Le UUID du Worflow reste fixe quelque soit sa  version. Le `workflow_id` est propre à la version du workflow.
* `file_path`⁣: Le chemin vers votre fichier.

Si l'extrait de code ci-dessous s'exécute correctement, un identifiant de job vous sera envoyé, confirmant que le fichier a bien été reçu et est en cours de traitement.

```python
import os
import requests

URL_SERVER = 'https://extract.workflows.recital.ai/workflows/api/v1'
workflow_uuid = "..."
file_path = "..."

filename = os.path.basename(file_path)
with open(file_path, "rb") as file:
    response = requests.post(
        url=f'{URL_SERVER}/jobs/',
        files={"file": (filename, file, "application/pdf")}, # Ici "file" désigne la collection dans laquelle le document sera envoyé
        params={"workflow_uuid": workflow_uuid},
        headers=headers
    )
    if response.status_code == 200:
        print(f"File {filename} is processing : {response.json()}")
    else:
        raise Exception(f"{filename} hasn't been uploaded - {response.status_code} - {response.reason} - {response.content}")
```

Si l'envoie du document s'est bien passé, vous pourrez suivre l'évolution de votre document dans l'onglet "[Jobs](/products/workflow/jobs.md)" du Workflow.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.recital.ai/products/integration-api/workflow/envoyer-des-documents-dans-un-workflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
