# How to run a service manually

## Introduction

In the event that you have a sync query but there are no failures in your [sync report](/product-documentation/patchworks-services/reporting-and-logging/service-sync-reports/viewing-the-service-sync-report.md), you may wish to run the associated service manually. To do this, follow the steps on this page.

{% hint style="warning" %}
Information on this page is for admin users only - screens shown here are not available to general users.
{% endhint %}

## Demo

{% embed url="<https://youtu.be/7gCYgbFOqhw>" %}

## The steps

**Step 1**\
Access the [services page](/product-documentation/patchworks-services/working-with-services/the-services-list.md).

{% hint style="info" %}
Please see [accessing services](/product-documentation/patchworks-services/working-with-services/accessing-services.md) if you're not sure how to get to this point.
{% endhint %}

**Step 2**\
Select the required service:

<figure><img src="/files/O4VqbmkJHOwuvw3bsJto" alt=""><figcaption></figcaption></figure>

**Step 3**\
Select the **run service** tab:

![](/files/Hx574NHrAJmILbWxTuYK)

{% hint style="info" %}
This tab is only available to admin users, for active services.
{% endhint %}

...the **run service** page is displayed:

<figure><img src="/files/CcwkshyYoFGXRYn0I4rW" alt=""><figcaption></figcaption></figure>

**Step 4**\
A range of options is available in different panels so you can control how this sync is run - set these as required. Key areas are highlighted in the screenshot above and summarised below:

<table><thead><tr><th width="102">Ref #</th><th>Panel / Option</th><th>Summary</th></tr></thead><tbody><tr><td>1</td><td>Service filters</td><td>Any filters <a href="/pages/b7OSm5jkuCB96nnr53ql">defined for this service </a>are shown here by default. <br><br>If required, you can change these settings. Available filters vary by source system however, you can always filter by ID. This is useful if you need to run the service for a specific item (e.g. an order, product, customer, stock item, etc.).<br><br>Unless you choose otherwise (by using the <strong>save settings to this service</strong> option), these filters will only apply when the service is run from this tab.  </td></tr><tr><td>2</td><td>From options</td><td><p>Define settings relating to the service source - i.e. the 'pull' operation: </p><ul><li><strong>Page size</strong>. Correlates to any pagination requirements the source system's API may have. If in doubt, leave as the default.</li><li><strong>Maximum attempts</strong>. Determines the number of times entries identified as duplicates and set to a status of 'failed' or 'pending' will be retried. </li><li><strong>Time zone</strong>. The  expected timezone associated with source data.</li><li><strong>Use JSON editor</strong>. If required settings are not available in dropdown lists here, custom settings can be added via the JSON editor.</li></ul></td></tr><tr><td>3</td><td>To options</td><td><p>Define settings relating to the service destination - i.e. the 'push' operation: </p><ul><li><strong>Time zone</strong>. The  expected timezone associated with destination data.</li><li><strong>Use JSON editor</strong>. If required settings are not available in dropdown lists here, custom settings can be added via the JSON editor.</li></ul></td></tr><tr><td>4</td><td>Service options</td><td><p>These options are most likely to be used (or suggested) by the Patchworks support team, for troubleshooting a sync issue: </p><ul><li><strong>Stop service before push</strong>. Allows a 'pull' operation to be completed and the payload reviewed, without updating the destination system.</li><li><strong>Force service</strong>. Run the service, irrespective of any retry limits which otherwise prevent another sync.</li><li><strong>Store pull payload</strong>. Make the payload generated from the 'pull' operation available to download once the service has run.  </li><li><strong>Store push payload</strong>. Make the payload generated from the 'push' operation available to download once the service has run. </li><li><strong>Store custom script payloads</strong>. Make the payload generated from the associated custom script available to download once the service has run. </li></ul><p>For further information please see the <a href="#about-payloads">about payloads </a>section below.</p></td></tr><tr><td>5</td><td>Stop service</td><td>Use this button to stop a service that is currently running.  </td></tr><tr><td>6</td><td>Save settings to this service</td><td>Use this button to apply <strong>from options</strong> and <strong>to options</strong> defined here to any scheduled syncs going forward. </td></tr><tr><td>7</td><td>Run service</td><td>Use this button to run the service.</td></tr><tr><td>8</td><td>Service log</td><td>Shows the status of this run. If auto-refresh is switched on (the default state) the log updates every five seconds, giving a live view of the sync.  For further information about logs, please see the <a href="/pages/Mxy4TuUh4yrQagEPmUrk">service logs</a> page.</td></tr><tr><td>9</td><td>Payloads</td><td>If you previously set options to <strong>store pull payload</strong> and/or <strong>store push payload</strong>, one or both of these buttons becomes active when the service run is completed.</td></tr><tr><td>10</td><td>Custom script payload</td><td>If you previously set the option to <strong>store custom script payload</strong>, this button becomes active when the service run is completed.</td></tr></tbody></table>

**Step 5**\
When you're ready, click the **run service** button.

{% hint style="info" %}
Any update may not be immediate as this run needs to take its place in the processing queue.
{% endhint %}

{% hint style="danger" %}
When you exit from this page, current settings, logs and download options are cleared - make sure you have what you need before navigating elsewhere.&#x20;
{% endhint %}

## About payloads

Payloads are stored in an S3 bucket within a Patchworks AWS instance, for 24 hours.&#x20;

Having exited the **run service** page, you can access these files via links in the [service log](/product-documentation/patchworks-services/reporting-and-logging/service-sync-logs.md#payload-files). These links remain active for 24 hours after the service run is completed. &#x20;

{% hint style="danger" %}
Remember that all settings, logs and download options are cleared when you exit the page.
{% endhint %}

Payloads are downloaded as a zip file containing the raw, translated payload.

## About the service log

The **service log** shows the status of the run that was just completed.


---

# 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://doc.wearepatchworks.com/product-documentation/patchworks-services/troubleshooting/how-to-run-a-service-manually.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.
