# SSDIWorkflow Two-Shortcut iPhone Guide

This guide is written for a person who does not build Shortcuts often.

You only build two Shortcuts:

```text
1. Start Workflow
2. End Workflow
```

This is the simplest daily flow:

```text
Tap Start Workflow
Work
Tap End Workflow
Choose screenshots or proof files
SSDIWorkflow opens a draft
Review
Save
```

Replace this example URL with your real Cloudflare Pages URL if different:

```text
https://ssdiworkflow.pages.dev
```

OCR text import template:

```text
https://ssdiworkflow.pages.dev/#text=[URL Encoded Text]
```

Universal import page:

```text
https://ssdiworkflow.pages.dev/#import
```

## Plain-English Definitions

In Apple Shortcuts:

- **Action** means one step, like `Get Current Date`.
- **Variable** means a saved value the Shortcut remembers, like `WorkDate`.
- **Set Variable** means give a value a name so you can use it later.
- **Text** means a box where you type a message or build a CSV row.
- **Shortcut Input** means the photo/file given to the Shortcut from the Share Sheet.
- **Recognized Text** means text iPhone OCR found in a screenshot.
- **URL Encode** means make text safe to put inside a web address.

## What The Shortcuts Can And Cannot Do

They can:

- Record start time.
- Record end time.
- Ask you to pick screenshots or proof files.
- Extract text from screenshot images.
- Open SSDIWorkflow with draft text.

They cannot:

- Secretly read another app.
- Guarantee OCR is correct.
- Fully read every PDF without a PDF parser.
- Save a final SSDI record without your review.

## Prepare iCloud Drive First

Open the iPhone **Files** app.

1. Tap **Browse**.
2. Tap **iCloud Drive**.
3. Open or create **Shortcuts**.
4. Inside it, create **SSDIWorkflow**.
5. Inside **SSDIWorkflow**, create:

```text
Logs
Evidence
Notes
```

The folder should look like:

```text
iCloud Drive/
  Shortcuts/
    SSDIWorkflow/
      Logs/
      Evidence/
      Notes/
```

## CSV Headers

The Start Workflow shortcut writes to:

```text
Shortcuts/SSDIWorkflow/Logs/Work_Session_Started.csv
```

Header:

```csv
sessionId,date,shiftStartTime,status,startNote,source,createdAt
```

The End Workflow shortcut writes to:

```text
Shortcuts/SSDIWorkflow/Logs/Work_Session_Completed.csv
Shortcuts/SSDIWorkflow/Logs/Import_Queue.csv
```

Headers:

```csv
sessionId,date,shiftStartTime,shiftEndTime,grossPay,milesDriven,totalTime,activeTime,status,notes,source,createdAt
```

```csv
importId,date,evidenceSource,evidenceType,filePath,ocrTextPath,status,createdAt
```

If iPhone asks to create a file, allow it.

## Shortcut 1: Start Workflow

Goal: press one button before work starts.

This keeps the same start-time function, but the name is clearer.

### Create It

1. Open **Shortcuts**.
2. Tap **+**.
3. Rename the shortcut:

```text
Start Workflow
```

### Add These Actions

1. Add action: **Get Current Date**.

2. Add action: **Format Date**.

Set:

```text
Format: Custom
Custom Format: yyyy-MM-dd
```

Add action: **Set Variable**.

Name:

```text
WorkDate
```

3. Add action: **Format Date** again.

Use Current Date.

Set:

```text
Format: Custom
Custom Format: HH:mm:ss
```

Set Variable:

```text
StartTime
```

4. Add action: **Format Date** again.

Use Current Date.

Set:

```text
Format: Custom
Custom Format: yyyyMMdd-HHmmss
```

Set Variable:

```text
Timestamp
```

5. Add action: **Text**.

Type:

```text
WORK-[Timestamp]
```

Replace `[Timestamp]` with the `Timestamp` variable.

Set Variable:

```text
SessionID
```

6. Add action: **Text**.

Type this CSV row:

```text
[SessionID],[WorkDate],[StartTime],STARTED,Started from Start Workflow,Shortcut,[Current Date]
```

Replace bracket words with variables.

Set Variable:

```text
StartedRow
```

7. Add action: **Append to File**.

Append:

```text
StartedRow
```

File path:

```text
Shortcuts/SSDIWorkflow/Logs/Work_Session_Started.csv
```

Turn on:

```text
Make New Line
```

8. Add action: **Text**.

Type:

```text
Work started
Session: [SessionID]
Date: [WorkDate]
Start: [StartTime]
```

Set Variable:

```text
StartNote
```

9. Add action: **Save File**.

Save:

```text
StartNote
```

To:

```text
Shortcuts/SSDIWorkflow/Notes/Shift_Start_[Timestamp].txt
```

10. Add action: **Show Alert**.

Message:

```text
Work timer started. Start mileage tracking now if you drive for work.
```

11. Optional action: **Open App**.

Choose your mileage app first.

Example:

```text
Stride
```

12. Optional action: **Wait**.

Set:

```text
10 seconds
```

This gives you time to tap Start/Track inside the mileage app.

13. Optional action: **Open App** again.

Choose your work app second.

Example:

```text
DoorDash
```

Recommended order:

```text
Open Stride
Wait 10 seconds
Open DoorDash
```

### Use It

Tap **Start Workflow** when you begin working.

## Shortcut 2: End Workflow

Goal: press one button when work ends. It stops the time record, asks for proof, extracts text, then opens SSDIWorkflow with a draft.

This combines the end-time function and proof capture into one Shortcut.

### Create It

1. Open **Shortcuts**.
2. Tap **+**.
3. Rename the shortcut:

```text
End Workflow
```

### Main Actions

1. Add action: **Get Current Date**.

2. Add action: **Format Date**.

Set:

```text
Format: Custom
Custom Format: yyyy-MM-dd
```

Set Variable:

```text
WorkDate
```

3. Add action: **Format Date** again.

Set:

```text
Format: Custom
Custom Format: HH:mm:ss
```

Set Variable:

```text
EndTime
```

4. Add action: **Ask for Input**.

Prompt:

```text
Gross pay if known. Put 0 if not sure.
```

Input type:

```text
Number
```

Set Variable:

```text
GrossPay
```

5. Add action: **Ask for Input**.

Prompt:

```text
Any short note? Leave blank if none.
```

Input type:

```text
Text
```

Set Variable:

```text
StopNote
```

6. Add action: **Text**.

Type:

```text
,[WorkDate],,[EndTime],[GrossPay],,,,PRELIMINARY,[StopNote],Shortcut,[Current Date]
```

Set Variable:

```text
CompletedRow
```

7. Add action: **Append to File**.

Append:

```text
CompletedRow
```

File path:

```text
Shortcuts/SSDIWorkflow/Logs/Work_Session_Completed.csv
```

Turn on:

```text
Make New Line
```

8. Add action: **Show Alert**.

Message:

```text
Now choose screenshots or proof files. You can select more than one.
```

9. Add action: **Select Photos**.

Settings:

```text
Include Images: On
Select Multiple: On
```

Set Variable:

```text
ProofImages
```

If you need PDFs, CSVs, or text files too, add **Get File from Folder** after this and allow multiple selection. For the easiest daily use, screenshots are enough.

10. Add action: **Text**.

Type:

```text
SSDI WORK IMPORT

```

Set Variable:

```text
ImportText
```

11. Add action: **Repeat with Each**.

Repeat each item in:

```text
ProofImages
```

Inside the repeat:

1. Add action: **Extract Text from Image**.
2. Use **Repeat Item** as the image.
3. Set Variable:

```text
RecognizedText
```

4. Add action: **Choose from Menu**.

Prompt:

```text
What is this screenshot?
```

Choices:

```text
Earnings / Pay / Time
Mileage
Receipt / Other
```

For **Earnings / Pay / Time**, add Text:

```text
EARNINGS APP TEXT:
[RecognizedText]

```

For **Mileage**, add Text:

```text
MILEAGE TEXT:
[RecognizedText]

```

For **Receipt / Other**, add Text:

```text
EARNINGS APP TEXT:
[RecognizedText]

```

Set the menu result as:

```text
ProofText
```

5. Add action: **Add to Variable**.

Add:

```text
ProofText
```

To variable:

```text
ImportText
```

6. Optional but recommended: add action **Save File** for the screenshot.

Save the Repeat Item to:

```text
Shortcuts/SSDIWorkflow/Evidence/[WorkDate]/
```

If this part is confusing, skip it. The app can still parse the text, but you should keep screenshots in Photos or Files.

12. After the repeat ends, add action: **URL Encode**.

Encode:

```text
ImportText
```

Set Variable:

```text
EncodedText
```

13. Add action: **Text**.

Type:

```text
https://ssdiworkflow.pages.dev/#text=[EncodedText]
```

Set Variable:

```text
AppUrl
```

14. Add action: **Open URLs**.

Open:

```text
AppUrl
```

15. Add action: **Show Notification**.

Message:

```text
End Workflow sent draft proof to SSDIWorkflow. Review before saving.
```

### Use It

1. Tap **End Workflow** when work is done.
2. Enter gross pay or `0`.
3. Enter a note or leave blank.
4. Select one or more screenshots.
5. For each screenshot, choose Earnings, Mileage, or Receipt/Other.
6. SSDIWorkflow opens.
7. Tap **Fill work log for review**.
8. Review pay, time, miles, and notes.
9. Tap **Save** only when correct.

## Recommended Simple Flow

For a non-technical user, use this routine:

```text
Start Workflow
Work
Take screenshots of pay/time/mileage
End Workflow
Select screenshots
Review draft in SSDIWorkflow
Save
End of month: Export CSV + Backup JSON
```

## Many Files, PDFs, CSVs, Text Files, Receipts

Use SSDIWorkflow **Import > Universal Work Evidence Import** when you have a batch of files.

You can choose:

- many screenshots
- PDFs
- CSV files
- text files
- mileage reports
- receipt images
- DoorDash proof
- Amazon Flex proof
- Stride proof

Current practical rule:

- iPhone screenshots work best when End Workflow extracts OCR text.
- CSV and text details can be pasted or imported.
- PDFs may need copy/paste text unless the app later adds a PDF parser.
- Images/PDFs are not final records by themselves.
- SSDIWorkflow should create a draft and require review.

## Parser Labels The App Understands

Use these exact labels:

```text
MILEAGE TEXT:
EARNINGS APP TEXT:
```

Mileage text should contain miles, Stride/mileage app data, deduction notes, or trip duration.

Earnings text should contain pay, work time, active time, delivery count, block pay, route details, or receipts.

## Important Safety Rules

- Never treat mileage deduction as gross pay.
- Never treat tax savings as gross pay.
- Never save OCR values without review.
- If OCR reads `32.10` as `3210`, correct it before saving.
- If active time is more than total time, correct it before saving.
- If multiple screenshots conflict, use official statements first.

## Code Review Notes From Universal Import Proposal

The referenced `SSDIWorkflow_Universal_Import_Codex_Implementation.md` proposes a React/TypeScript implementation with `papaparse`, `pdfjs-dist`, and `tesseract.js`. SSDIWorkflow is currently a plain static HTML/CSS/JS app, so that exact code cannot be pasted in directly without converting the app stack.

Recommended path:

1. Keep the two-shortcut flow now.
2. Let End Workflow do image OCR on iPhone because it is already built into Shortcuts.
3. Keep selected proof files local and attach their names to draft notes.
4. Add a heavier universal parser later only if you are ready to add libraries and larger deployment files.

If OCR/PDF parsing is added later, preserve these rules:

- Parse into `Needs Review` drafts only.
- Never auto-save final SSDI work entries.
- Keep gross pay, mileage, deductions, receipts, and tax notes separate.
- Warn when gross pay is missing or a dollar amount may be tax savings/deduction.
- Keep evidence private and local unless the user explicitly chooses upload/sync.
