Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/guides/workflow-run-job-from-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/workflow-run-job-from-entry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/workflow-run-job-from-table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/workflow-run-select-filled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/workflow-run-select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/workflows-run-selected-entry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 43 additions & 24 deletions guides/pl-ksef.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -465,23 +465,30 @@ Once you've configured the import, sync, and registration workflows, the [Cron a

#### Manual import

If you need to import invoices outside of the automatic cron schedule, you can manually trigger imports using the Invopop API.

<Note>
Manual import with workflow arguments is only available via API. The Console UI does not currently support passing custom arguments to workflow jobs.
</Note>
If you need to import invoices outside of the automatic cron schedule, you can manually trigger imports from the [Console](/guides/workflows#running-from-the-console) or via the API.

**Import a single invoice**

To import a specific invoice from KSeF:
To import a specific invoice from KSeF, you need:

<Steps>
<Step title="Get invoice details from the KSeF portal">
- **KSeF Number**: The unique invoice identifier (e.g., `1234567890-20260120-ABCD1234-EF`)
- **Supplier NIP**: The Polish Tax ID of the invoice issuer
</Step>
- **KSeF Number**: The unique invoice identifier (e.g., `1234567890-20260120-ABCD1234-EF`)
- **Supplier NIP**: The Polish Tax ID of the invoice issuer

<Step title="Create a job via API">
<Tabs>
<Tab title="Console">
1. Navigate to **Workflows** and find your **KSeF Import Invoice** workflow
2. Click **Run** from the workflow editor or the `...` menu in the workflow list (see [Running from the Console](/guides/workflows#running-from-the-console))
3. Leave the document field empty — the import workflow will create a new silo entry automatically
4. Fill in the **Arguments**:

| Key | Value |
|-----|-------|
| `ksef-number` | `1234567890-20260120-ABCD1234-EF` |
| `nip` | `1234567890` |

5. Click <kbd>Run workflow</kbd>
</Tab>
<Tab title="API">
Use the [Create a Job endpoint](/api-ref/transform/jobs/create-a-job-post):

```bash
Expand All @@ -496,21 +503,33 @@ To import a specific invoice from KSeF:
}
}'
```
</Tab>
</Tabs>

The invoice will be downloaded from KSeF, converted to GOBL, and stored in your silo.
</Step>
</Steps>
The invoice will be downloaded from KSeF, converted to GOBL, and stored in your silo.

**Import multiple invoices by date range**

To import all invoices received within a specific time period:
To import all invoices received within a specific time period, you need:

<Steps>
<Step title="Determine the date range">
Decide the date range you want to sync (from and upto dates).
</Step>
- The **party silo entry** for the supplier whose invoices you want to sync
- The **date range** (`from` and `upto`) to process

<Step title="Create a job via API">
<Tabs>
<Tab title="Console">
1. Navigate to **Workflows** and find your **KSeF Sync Received Invoices** workflow
2. Click **Run** from the workflow editor or the `...` menu in the workflow list
3. In the **Select a document** field, search for and select the party (supplier) entry
4. Fill in the **Arguments**:

| Key | Value |
|-----|-------|
| `from` | `2026-01-01T00:00:00Z` |
| `upto` | `2026-01-31T23:59:59Z` |

5. Click <kbd>Run workflow</kbd>
</Tab>
<Tab title="API">
Use the [Create a Job endpoint](/api-ref/transform/jobs/create-a-job-post) with your sync workflow:

```bash
Expand All @@ -526,10 +545,10 @@ To import all invoices received within a specific time period:
}
}'
```
</Tab>
</Tabs>

The sync workflow will query KSeF for all invoices received in that date range and create individual import jobs for each invoice found.
</Step>
</Steps>
The sync workflow will query KSeF for all invoices received in that date range and create individual import jobs for each invoice found.

<Tip>
Use single invoice import to bring in a specific invoice immediately after receiving notification from a supplier. Use date range sync to backfill invoices or to import historical invoices from before the cron subscription was active.
Expand Down
57 changes: 57 additions & 0 deletions guides/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,63 @@ Workflows in Invopop can be executed through the following methods:

Workflows are executed on _silo entries_ (such as invoices or suppliers), this action creates a _job_. When a job is run, the silo entry will be updated with any changes or attachments generated during processing. The status of a job can be seen in the silo entry's activity tab, or in the **Workflows** → **History** section accessible from the left sidebar.

### Running from the Console

There are three ways to run a workflow from the Console:

#### From a silo entry

While viewing an invoice, supplier, or other silo entry, click <kbd>Run Workflow</kbd> in the top toolbar.

<Frame>
<img src="/assets/guides/workflow-run-job-from-entry.png" width="100%" alt="Run Workflow button in the silo entry toolbar" />
</Frame>

This opens a panel where you search for and select the workflow to run. The current entry is used as the document automatically.

<Frame>
<img src="/assets/guides/workflows-run-selected-entry.png" width="340" alt="Workflow selection panel from a silo entry" />
</Frame>

Click <kbd>Run Workflow</kbd> to create the job. This method does not support passing arguments — the job runs with the selected entry only.

#### From the workflow editor or list

You can also start a run from the workflow side:

- **From the workflow editor**: Click the **Run** button in the top bar while viewing a workflow.

<Frame>
<img src="/assets/guides/workflow-run-job-from-editor.png" width="100%" alt="Run button in the workflow editor" />
</Frame>

- **From the workflow list**: Click the `...` menu on any workflow row and select **Run**.

<Frame>
<img src="/assets/guides/workflow-run-job-from-table.png" width="100%" alt="Run option in the workflow list menu" />
</Frame>

Both options open a panel where you configure the job inputs:

<Frame>
<img src="/assets/guides/workflow-run-select.png" width="340" alt="Run workflow panel with document and arguments fields" />
</Frame>

- **Select a document**: Search for and select an existing silo entry (invoice, supplier, etc.) to process.
- **Arguments**: Provide string key-value pairs that will be passed to the workflow steps. The specific keys and values depend on the workflow — for example, a KSeF import workflow might expect a `ksef-number` and `nip` argument.

A job requires **at least one** of these: a document or arguments. You can also provide both. For example, a sync workflow may need a party document selected _and_ date range arguments.

<Frame>
<img src="/assets/guides/workflow-run-select-filled.png" width="340" alt="Run workflow panel with a document and arguments filled in" />
</Frame>

Click <kbd>Run workflow</kbd> to create the job.

<Note>
When a job is run with arguments only and no document selected, the workflow will typically create a new silo entry or fetch an existing one based on the arguments provided. For example, an import workflow receiving a document identifier as an argument will download the document and create a corresponding silo entry automatically.
</Note>

## Error Handling

Any step that causes an error (`KO`) from which the job can't recover, and is not handled through a condition, will trigger the error handling flow. To enable this section, tap on **Handle Errors** at the bottom of the workflow creation screen, then add steps into this area which you want to execute when the job fails (often times setting the entry's state to `Error` and possibly sending a notification).
Expand Down
Loading